perm filename INTERP.DIF[EAL,HE] blob
sn#701193 filedate 1983-03-18 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00071 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00012 00002 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 1,1
C00016 00003 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 1,1
C00020 00004 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 1,1
C00023 00005 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 1,1
C00027 00006 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 1,1
C00030 00007 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 1,1
C00034 00008 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 3,3
C00037 00009 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 4,4
C00040 00010 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 6,6
C00043 00011 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 6,6
C00047 00012 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 10,10
C00050 00013 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 12,12
C00053 00014 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 12,12
C00056 00015 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 15,15
C00059 00016 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 18,18
C00063 00017 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 18,18
C00066 00018 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 18,18
C00069 00019 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 18,18
C00072 00020 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 19,19
C00075 00021 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 19,19
C00078 00022 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 19,19
C00081 00023 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 19,19
C00084 00024 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 19,19
C00087 00025 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 20,20
C00090 00026 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 21,21
C00093 00027 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 34,34
C00096 00028 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 37,37
C00099 00029 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 37,37
C00102 00030 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 37,37
C00105 00031 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 37,37
C00108 00032 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 37,37
C00111 00033 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 38,41
C00114 00034 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 39,41
C00117 00035 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 40,42
C00120 00036 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 40,42
C00124 00037 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 46,45
C00127 00038 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 46,45
C00130 00039 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 46,45
C00133 00040 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 46,45
C00136 00041 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 47,46
C00140 00042 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
C00143 00043 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
C00147 00044 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
C00150 00045 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
C00153 00046 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
C00156 00047 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
C00159 00048 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
C00162 00049 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
C00166 00050 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
C00169 00051 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
C00172 00052 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
C00175 00053 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
C00178 00054 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
C00181 00055 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
C00184 00056 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
C00188 00057 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
C00191 00058 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 49,48
C00194 00059 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 50,49
C00197 00060 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 50,49
C00200 00061 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 51,50
C00203 00062 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 52,51
C00206 00063 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 52,51
C00209 00064 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 53,51
C00212 00065 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 54,52
C00215 00066 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 54,52
C00218 00067 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 55,53
C00221 00068 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 56,54
C00224 00069 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 57,55
C00227 00070 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 58,55
C00229 00071 1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 58,55
C00231 ENDMK
C⊗;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 1,1
**** File 1) INTERP.PAS[AL,HE]/1P/1L
1) COMMENT ⊗ VALID 00058 PAGES
1) C REC PAGE DESCRIPTION
**** File 2) U:INTERP.PAS[AL2,RV]/1P/1L
2) COMMENT ⊗ VALID 00055 PAGES
2) C REC PAGE DESCRIPTION
***************
**** File 1) INTERP.PAS[AL,HE]/1P/5L
1) C00013 00003 (* datatype definitions *)
1) C00016 00004 (* statement definitions *)
1) C00020 00005 (* auxiliary definitions: variable, etc. *)
1) C00022 00006 (* definition of the ubiquitous NODE record *)
1) C00029 00007 (* records for parser: ident, token, resword *)
1) C00032 00008 (* process descriptor blocks & environment record definitions *)
1) C00036 00009 (* definition of AL-ARM messages *)
1) C00038 00010 (* global variables *)
1) C00040 00011 (* external routines *)
1) C00047 00012 (* message passing routines: sendCmd, sendTrans, getReply, whereArm *)
1) C00052 00013 (* aux routines: push, pop, upTrans, getELev, getEntry, getVar, gtVarn, getVal, setVal, getNval *)
1) C00061 00014 (* aux routines: getPdb, freePdb, getEvent, freeEvent *)
1) C00064 00015 (* graph structure routines: nextTime, getFrame, getDevice, feval, eval, change, invalidate, stvals ... *)
1) C00076 00016 (* aux routines to create & destroy variables: enterEntry,makeCmon,makeVar,killVar,killEnv,killNode,killStack *)
1) C00088 00017 (* aux io routines: prntSval, prntVec, prntTrans, prntStrng, prntPlist, onum, prntVar, badjoints *)
1) C00093 00018 (* aux routines: addPdb, sleep, deClkQueue, msgDispatch, swap *)
1) C00110 00019 (* aux routines: calibrate,initArms,initWorld,consDef,passConstants,flushLevel,flushAll,unwind,flushPdb,flushKids *)
1) C00130 00020 (* aux routines: cmonEnable, cmonDisable, cmonCheck *)
1) C00136 00021 (* expression evaluator: evalExp *)
1) C00155 00022 procedure doProg (* ** ** *)
1) C00156 00023 procedure doBlock
1) C00158 00024 procedure doCoblock
1) C00161 00025 procedure doEnd
1) C00165 00026 procedure doFor
1) C00168 00027 procedure doIf
1) C00169 00028 procedure doWhile
1) C00170 00029 procedure doUntil
1) C00171 00030 procedure doCase
1) C00173 00031 procedure doCall
1) C00174 00032 procedure doReturn
1) C00178 00033 procedure doPrint
1) C00179 00034 procedure doPrompt
1) C00181 00035 procedure doPause
1) C00182 00036 procedure doAbort
1) C00184 00037 procedure doSay
1) C00191 00038 procedure doAssign
1) C00193 00039 procedure doSignal
1) C00195 00040 procedure doWait
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 1,1
1) C00197 00041 procedure doEnable
1) C00198 00042 procedure doDisable
1) C00199 00043 (* affixment auxiliary routines: affixaux, unfixaux & unfix *)
1) C00205 00044 procedure doAffix
1) C00211 00045 procedure doUnfix
1) C00212 00046 (* aux routines for motions: forcebits, getMechbits, moveStart, moveEnd, moveRetry *)
1) C00227 00047 procedure doCmon
1) C00234 00048 procedure doMove
1) C00262 00049 procedure doOperate
1) C00266 00050 procedure doOpen (* & doClose *)
1) C00273 00051 procedure doCenter
1) C00275 00052 procedure doArmmagic
1) C00279 00053 procedure doFloat
1) C00282 00054 procedure doStop
1) C00284 00055 procedure doRetry
1) C00286 00056 procedure doSetbase
1) C00288 00057 procedure doWrist
1) C00291 00058 (* command loop *)
1) C00303 ENDMK
1) C⊗;
1) (*$E+ Routines to interpret an AL program *)
1) (*$S4000 use an even larger codesize (was using 3000) *)
1) program interp;
1) const
1) version = 10; (* 10 for simulation version, 11 for real thing *)
1) (* the following other routines need to be manually *)
1) (* changed when running with the servo: *)
1) (* procedure bitOn (in Calibrate) *)
1) (* procedure initWorld (rewrite at end) *)
1) (* Also the external definitions for the various *)
1) (* procedures from RSXMSG need to be fixed *)
1) (* The following bits are used during calls to the ARM servo *)
1) YARMDEV = (*1B*) 1; (* device bits for: yellow arm *)
1) YHANDDEV = (*2B*) 2;
1) BARMDEV = (*4B*) 4;
1) BHANDDEV = (*10B*) 8;
1) VISEDEV = (*20B*) 16;
1) DRIVERDEV = (*40B*) 32;
1) GARMDEV = (*100B*) 64;
1) GHANDDEV = (*200B*) 128;
1) RARMDEV = (*400B*) 256;
1) RHANDDEV = (*1000B*) 512;
1) FTABLE = (*400B*) 256; (* Force trans (C) in table coordinates *)
1) FHAND = 0; (* " " " " hand coordinate system *)
1) XFORCE = 0; (* Force along X direction of C *)
1) YFORCE = (*1000B*) 512; (* " " Y " " " *)
1) ZFORCE = (*2000B*) 1024; (* " " Z " " " *)
1) XMOMENT = (*3000B*)1536; (* Moment about X direction of C *)
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 1,1
1) YMOMENT = (*4000B*)2048; (* " " Y " " " *)
1) ZMOMENT = (*5000B*)2560; (* " " Z " " " *)
1) FSTOP = (*10000B*)4096; (* In addition to starting cmon, stop arm *)
1) SIGMAG = (*20000B*)8192; (* Test only magnitude of forces *)
1) SIGGE = (*100000B*) 32768; (* Start cmon if force ≥ specified value *)
1) SIGLT = 0; (* " " " " < " " *)
1) ghandpower = 1; (* bit defs - used in response to initarmscmd *)
1) rhandpower = 2;
1) GARMPOWER = 4;
1) RARMPOWER = (*10B*) 8;
1) GARMCAL = (*400B*) 256;
1) RARMCAL = (*1000B*) 512;
1) ghandcal = (*2000B*) 1024;
1) rhandcal = (*4000B*) 2048;
1) (* control bits for trajectory specs: movesegcmd & movehdrcmd *)
1) Viaptcb = 1; Joint1cb = 1; (* 1B *)
1) Deptptcb = 2; Joint2cb = 2; (* 2B *)
1) Apprptcb = 4; Joint3cb = 4; (* 4B *)
1) Destptcb = 8; Joint4cb = 8; (* 10B *)
1) Veloccb = 16; Joint5cb = 16; (* 20B *)
1) Codecb = 32; Joint6cb = 32; (* 40B *)
1) Durlbcb = 64; (* 100B *)
1) Durubcb = 128; (* 200B *)
1) Dureqcb = 192; (* 300B *)
1) Byptcb = 256; Linearcb = 256; (* 400B *)
1) Nullingcb = 512; (* 1000B *)
1) Shouldercb = 1024; Wobblecb = 1024; (* 2000B *)
1) Rightcb = 2048; Speedfcb = 2048; (* 4000B *)
1) Elbowcb = 4096; Loadcb = 4096; (* 10000B *)
1) Upcb = 8192; (* 20000B *)
1) Wristcb = 16384; (* 40000B *)
1) Flipcb = 32768; (* 100000B *)
1) maxInt = 32767; (* max 16 bit integer *)
1) (* Control character definitions and others *)
1) ctlA = 01; (* Control-A *)
1) ctlB = 02;
1) ctlC = 03;
1) ctlD = 04;
1) ctlE = 05;
1) ctlF = 06;
1) ctlG = 07;
1) ctlH = 08;
1) ctlI = 09;
1) ctlJ = 10;
1) ctlK = 11;
1) ctlL = 12;
1) ctlM = 13;
1) ctlN = 14;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 1,1
1) ctlO = 15;
1) ctlP = 16;
1) ctlQ = 17;
1) ctlR = 18;
1) ctlS = 19;
1) ctlT = 20;
1) ctlU = 21;
1) ctlV = 22;
1) ctlW = 23;
1) ctlX = 24;
1) ctlY = 25;
1) ctlZ = 26;
1) FF = ctlL; (* Form feed *)
1) CR = ctlM; (* Carriage return *)
1) LF = ctlJ; (* Line feed *)
1) TAB = ctlI; (* Tab *)
1) ESC = 27; (* Escape *)
1) smallA = 97; (* Lowercase a (sail pascal converts all input to upper case) *)
1) smallZ = 122;
1) undline = 95; (* Underline _ *)
1) vbar = 124; (* Vertical bar | *)
1) lbrace = 123; (* Left brace (curly bracket) *)
1) rbrace = 126; (* and right brace *)
1) deletekey = 127; (* Delete key code *)
1) type
**** File 2) U:INTERP.PAS[AL2,RV]/1P/5L
2) C00010 00003 (* datatype definitions *)
2) C00013 00004 (* statement definitions *)
2) C00017 00005 (* auxiliary definitions: variable, etc. *)
2) C00019 00006 (* definition of the ubiquitous NODE record *)
2) C00025 00007 (* records for parser: ident, token, resword *)
2) C00028 00008 (* process descriptor blocks & environment record definitions *)
2) C00032 00009 (* definition of AL-ARM messages *)
2) C00034 00010 (* global variables *)
2) C00036 00011 (* external routines *)
2) C00043 00012 (* message passing routines: sendCmd, sendTrans, getReply, whereArm *)
2) C00047 00013 (* aux routines: push, pop, upTrans, getELev, getEntry, getVar, gtVarn, getVal, setVal, getNval *)
2) C00056 00014 (* aux routines: getPdb, freePdb, getEvent, freeEvent *)
2) C00059 00015 (* graph structure routines: nextTime, getFrame, getDevice, feval, eval, change, invalidate, stvals ... *)
2) C00071 00016 (* aux routines to create & destroy variables: enterEntry,makeCmon,makeVar,killVar,killEnv,killNode,killStack *)
2) C00083 00017 (* aux io routines: prntSval, prntVec, prntTrans, prntStrng, prntPlist, onum, prntVar, badjoints *)
2) C00088 00018 (* aux routines: addPdb, sleep, deClkQueue, msgDispatch, swap *)
2) C00099 00019 (* aux routines: initArms,initWorld,consDef,passConstants,flushLevel,flushAll,unwind,flushPdb,flushKids *)
2) C00113 00020 (* aux routines: cmonEnable, cmonDisable, cmonCheck *)
2) C00119 00021 (* expression evaluator: evalExp *)
2) C00137 00022 procedure doProg (* ** ** *)
2) C00138 00023 procedure doBlock
2) C00140 00024 procedure doCoblock
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 1,1
2) C00143 00025 procedure doEnd
2) C00147 00026 procedure doFor
2) C00150 00027 procedure doIf
2) C00151 00028 procedure doWhile
2) C00152 00029 procedure doUntil
2) C00153 00030 procedure doCase
2) C00155 00031 procedure doCall
2) C00156 00032 procedure doReturn
2) C00160 00033 procedure doPrint
2) C00161 00034 procedure doPrompt
2) C00163 00035 procedure doPause
2) C00164 00036 procedure doAbort
2) C00166 00037 procedure doAssign
2) C00168 00038 procedure doSignal
2) C00170 00039 procedure doWait
2) C00172 00040 procedure doEnable
2) C00173 00041 procedure doDisable
2) C00174 00042 (* affixment auxiliary routines: affixaux, unfixaux & unfix *)
2) C00180 00043 procedure doAffix
2) C00186 00044 procedure doUnfix
2) C00187 00045 (* aux routines for motions: forcebits, getMechbits, moveStart, moveEnd, moveRetry *)
2) C00202 00046 procedure doCmon
2) C00208 00047 procedure doMove
2) C00228 00048 procedure doOperate
2) C00232 00049 procedure doOpen (* & doClose *)
2) C00238 00050 procedure doCenter
2) C00240 00051 procedure doStop
2) C00242 00052 procedure doRetry
2) C00244 00053 procedure doSetbase
2) C00245 00054 procedure doWrist
2) C00247 00055 (* command loop *)
2) C00258 ENDMK
2) C⊗;
2) (*$E+ Routines to interpret an AL program *)
2) (*$S3000 use a large codesize *)
2) program interp;
2) (* The following bits are used during calls to the ARM servo *)
2) const
2) YARMDEV = 1; (* device numbers *)
2) YHANDDEV = 2;
2) BARMDEV = 3;
2) BHANDDEV = 4;
2) VISEDEV = 5;
2) DRIVERDEV = 6;
2) GARMDEV = 7;
2) GHANDDEV = 8;
2) RARMDEV = 9;
2) RHANDDEV = 10;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 1,1
2) YELARM = 1B; (* Yellow arm *)
2) BLUARM = 4B; (* Blue arm *)
2) FTABLE = 400B; (* Force trans (C) in table coordinates *)
2) FHAND = 0B; (* " " " " hand coordinate system *)
2) XFORCE = 0B; (* Force along X direction of C *)
2) YFORCE = 1000B; (* " " Y " " " *)
2) ZFORCE = 2000B; (* " " Z " " " *)
2) XMOMENT = 3000B; (* Moment about X direction of C *)
2) YMOMENT = 4000B; (* " " Y " " " *)
2) ZMOMENT = 5000B; (* " " Z " " " *)
2) FSTOP = 10000B; (* In addition to starting cmon, stop arm *)
2) SIGMAG = 20000B; (* Test only magnitude of forces *)
2) SIGGE = 100000B; (* Start cmon if force ≥ specified value *)
2) SIGLT = 0B; (* " " " " < " " *)
2) BARMPOWER = 1B; (* bit defs - used in response to initarmscmd *)
2) YARMPOWER = 2B;
2) GARMPOWER = 4B;
2) RARMPOWER = 10B;
2) GARMCAL = 400B;
2) RARMCAL = 1000B;
2) NULLINGCB = 1B; (* control bits for trajectory specs *)
2) WOBBLECB = 2B;
2) DURLBCB = 20B; (* Duration: lower, upper & exact bounds *)
2) DURUBCB = 40B;
2) DUREQCB = 60B;
2) VELOCCB = 100B;
2) CODECB = 200B;
2) VIAPTCB = 400B;
2) DEPRPTCB = 1000B;
2) APPRPTCB = 2000B;
2) DESTPTCB = 10000B;
2) type
***************
**** File 1) INTERP.PAS[AL,HE]/2P/131L
1) (* Here are all the pointer-type definitions. Since the various *)
1) (* records reference each other so much, we have to put them all here. *)
**** File 2) U:INTERP.PAS[AL2,RV]/2P/69L
2) (* Here are all the pointer-type definitions. Since the various *)
2) (* records reference each other so much, we have to put them all here. *)
***************
**** File 1) INTERP.PAS[AL,HE]/3P/12L
1) cstring = packed array [1..10] of ascii;
1) c4str = packed array [1..4] of ascii;
1) c5str = packed array [1..5] of ascii;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 3,3
1) c20str = packed array [1..20] of ascii;
1) strng = record
**** File 2) U:INTERP.PAS[AL2,RV]/3P/12L
2) cstring = packed array [0..9] of ascii;
2) c4str = packed array [0..3] of ascii;
2) c5str = packed array [0..4] of ascii;
2) c20str = packed array [0..19] of ascii;
2) strng = record
***************
**** File 1) INTERP.PAS[AL,HE]/4P/9L
1) movetype,jtmovetype,operatetype,opentype,closetype,centertype,
1) floattype, stoptype, retrytype,
1) requiretype, definetype, macrotype, commenttype, dimdeftype,
1) setbasetype, wristtype, saytype, declaretype, emptytype,
1) evaltype, armmagictype);
1) (* more??? *)
1) statement = packed record
1) next, last: statementp;
1) stlab: varidefp;
**** File 2) U:INTERP.PAS[AL2,RV]/4P/9L
2) movetype, operatetype, opentype, closetype, centertype,
2) stoptype, retrytype,
2) requiretype, definetype, macrotype, commenttype, dimdeftype,
2) setbasetype, wristtype, tovaltype, declaretype, emptytype);
2) (* more??? *)
2) statement = packed record
2) next, last: statementp; (* ↑ to lexical tokens? *)
2) stlab: varidefp;
***************
**** File 1) INTERP.PAS[AL,HE]/4P/21L
1) bpt,bad: boolean;
1) case stype: stmntypes of
**** File 2) U:INTERP.PAS[AL2,RV]/4P/20L
2) bpt: boolean;
2) case stype: stmntypes of
***************
**** File 1) INTERP.PAS[AL,HE]/4P/39L
1) aborttype,
1) saytype: (plist: nodep; debugLev: integer);
1) returntype: (retval, rproc: nodep);
1) evaltype,
1) calltype,
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 4,4
**** File 2) U:INTERP.PAS[AL2,RV]/4P/38L
2) aborttype: (plist: nodep; debugLev: integer);
2) returntype: (retval, rproc: nodep);
2) calltype,
***************
**** File 1) INTERP.PAS[AL,HE]/4P/50L
1) jtmovetype,
1) operatetype,
**** File 2) U:INTERP.PAS[AL2,RV]/4P/47L
2) operatetype,
***************
**** File 1) INTERP.PAS[AL,HE]/4P/55L
1) floattype,
1) setbasetype,
1) stoptype: (cf, clauses: nodep);
1) retrytype: (rcode, rparent: statementp; olevel: integer);
1) wristtype: (arm, ff, fvec, tvec: nodep; csys: boolean);
1) cmtype: (oncond: nodep; conclusion: statementp;
**** File 2) U:INTERP.PAS[AL2,RV]/4P/51L
2) stoptype: (cf, clauses: nodep);
2) retrytype: (rcode, rparent: statementp; olevel: integer);
2) cmtype: (oncond: nodep; conclusion: statementp;
***************
**** File 1) INTERP.PAS[AL,HE]/4P/68L
1) armmagictype: (cmdnum,dev,iargs,oargs: nodep);
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/4P/61L
2) setbasetype,
2) wristtype: (fvec, tvec: nodep);
2) tovaltype: (vstr: strngp; vlen: integer; waitp: boolean);
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/6P/4L
1) deprnode, viaptnode, apprnode, destnode, byptnode, durnode,
1) sfacnode, wobblenode, swtnode, nullingnode, wristnode, cwnode,
**** File 2) U:INTERP.PAS[AL2,RV]/6P/4L
2) deprnode, viaptnode, apprnode, destnode, durnode,
2) sfacnode, wobblenode, swtnode, nullingnode, wristnode, cwnode,
***************
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 6,6
**** File 1) INTERP.PAS[AL,HE]/6P/9L
1) waitlistnode, procdefnode, tlistnode, dimnode, commentnode,
1) linearnode, elbownode, shouldernode, flipnode, wrtnode,
1) loadnode,velocitynode);
1) exprtypes = ( svalop, (* scalar operators *)
**** File 2) U:INTERP.PAS[AL2,RV]/6P/9L
2) waitlistnode, procdefnode, tlistnode, dimnode, commentnode);
2) exprtypes = ( svalop, (* scalar operators *)
***************
**** File 1) INTERP.PAS[AL,HE]/6P/31L
1) arefop, callop, grinchop, macroop, vmop, adcop, dacop, jointop,
1) badop,
**** File 2) U:INTERP.PAS[AL2,RV]/6P/29L
2) arefop, callop, grinchop, macroop, vmop, adcop, dacop,
2) badop,
***************
**** File 1) INTERP.PAS[AL,HE]/6P/56L
1) wrtnode,
1) deprnode,
**** File 2) U:INTERP.PAS[AL2,RV]/6P/54L
2) deprnode,
***************
**** File 1) INTERP.PAS[AL,HE]/6P/60L
1) byptnode,
1) viaptnode: (vlist: boolean; via,vclauses: nodep; vcode: statementp);
1) durnode: (durrel: reltypes; durval: nodep);
1) velocitynode,
1) sfacnode,
**** File 2) U:INTERP.PAS[AL2,RV]/6P/57L
2) viaptnode: (vlist: boolean; via,duration,velocity: nodep; vcode: statementp);
2) durnode: (durrel: reltypes; durval: nodep);
2) sfacnode,
***************
**** File 1) INTERP.PAS[AL,HE]/6P/67L
1) nullingnode, (* true = nonulling *)
1) wristnode, (* = don't zero force wrist *)
1) cwnode, (* = counter_clockwise *)
1) elbownode, (* = elbow up *)
1) shouldernode, (* = right shoulder *)
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 6,6
1) flipnode, (* = don't flip wrist *)
1) linearnode: (notp: boolean); (* = linear motion *)
1) ffnode: (ff,cf: nodep; csys, pdef: boolean); (* true = world, false = hand *)
1) loadnode: (loadval,loadvec: nodep; lcsys: boolean); (* lcsys = csys above *)
1) forcenode: (ftype: forcetypes; frel: reltypes; fval, fvec, fframe: nodep);
1) stiffnode: (fv, mv, cocff: nodep);
1) gathernode: (gbits: integer);
**** File 2) U:INTERP.PAS[AL2,RV]/6P/62L
2) nullingnode,
2) wristnode,
2) cwnode: (notp: boolean); (* true = nonulling/zero wrist/counter_clockwise *)
2) ffnode: (ff: nodep; csys, pdef: boolean); (* true = world, false = hand *)
2) forcenode: (ftype: forcetypes; frel: reltypes; fval, fvec, fframe: nodep);
2) stiffnode: (fv, mv, coc: nodep);
2) gathernode: (gbits: integer);
***************
**** File 1) INTERP.PAS[AL,HE]/9P/5L
1) centercmd,operatecmd,movedonecmd,signalcmd,
1) setccmd,forcesigcmd,forceoffcmd,biasoncmd,biasoffcmd,setstiffcmd,
1) zerowristcmd,wristcmd,gathercmd,getgathercmd,readadccmd,writedaccmd,
1) errorcmd,floatcmd,settoolcmd,setloadcmd,
1) armmagiccmd,realcmd,vectorcmd,transcmd);
1) errortypes = (noerror,noarmsol,timerr,durerr,toolong,useopr,nosuchdev,featna,
1) unkmess,srvdead,adcdead,nozind,exjtfc,paslim,nopower,badpot,devbusy,
1) baddev,timout,panicb,nocart,cbound);
1) message = record
**** File 2) U:INTERP.PAS[AL2,RV]/9P/5L
2) centercmd,operatecmd,movedonecmd,signalcmd,readjtcmd,drivecmd,
2) setccmd,forcesigcmd,forceoffcmd,biasoncmd,biasoffcmd,setstiffcmd,
2) zerowristcmd,wristcmd,gathercmd,getgathercmd,readadccmd,writedaccmd,
2) errorcmd,floatcmd);
2) errortypes = (noerror,noarmsol,timerr,durerr,toolong,useopr,nosuchdev,featna,
2) unkmess,srvdead,adcdead,nozind,exjtfc,paslim,nopower,badpot,devbusy,
2) baddev,timout,panicb);
2) message = record
***************
**** File 1) INTERP.PAS[AL,HE]/10P/11L
1) msg: messagep; (* for AL-ARM interaction *)
**** File 2) U:INTERP.PAS[AL2,RV]/10P/11L
2) (* tty,ttyoutput: text; (* for terminal i/o *)
2) msg: messagep; (* for AL-ARM interaction *)
***************
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 10,10
**** File 1) INTERP.PAS[AL,HE]/10P/17L
1) talk: text; (* for using the speech synthesizer *)
1) (* various constant pointers *)
**** File 2) U:INTERP.PAS[AL2,RV]/10P/19L
2) (* various constant pointers *)
***************
**** File 1) INTERP.PAS[AL,HE]/10P/22L
1) bpark, gpark, rpark: transp; (* arm park positions *)
1) (* various device & variable pointers *)
1) speedfactor: enventryp;
1) garm: framep;
1) (* external routines *)
**** File 2) U:INTERP.PAS[AL2,RV]/10P/22L
2) bpark, ypark, gpark, rpark: transp; (* arm park positions *)
2) (* various device & variable pointers *)
2) speedfactor: enventryp;
2) barm: framep;
2) (* external routines *)
***************
**** File 1) INTERP.PAS[AL,HE]/11P/71L
1) procedure initMsg(var buf: messagep; var flag: boolean);
1) begin new(buf); buf↑.ok := true end; (* for simulation version *)
1) function sendArm: boolean; begin sendArm := true; end;
1) function getArm: boolean; begin getArm := true; end;
1) procedure signalArm; begin end;
1) procedure ppLine; extern; (* from EDIT.PAS *)
**** File 2) U:INTERP.PAS[AL2,RV]/11P/71L
2) function sendArm: boolean; begin sendArm := true; end;
2) function getArm: boolean; begin getArm := true; end;
2) procedure ppLine; extern; (* from EDIT.PAS *)
***************
**** File 1) INTERP.PAS[AL,HE]/11P/90L
1) function anyChar(var ch: ascii): boolean; extern; (* from DISP.FAI *)
1) function getChar: ascii; extern;
1) procedure escInit(var flg: boolean); extern;
**** File 2) U:INTERP.PAS[AL2,RV]/11P/87L
2) (* procedure freeStatement(s: statementp); extern; *) (* from FREE.PAS *)
2) function anyChar(var ch: ascii): boolean; extern; (* from DISP.FAI *)
2) procedure escInit(var flg: boolean); extern;
***************
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 12,12
**** File 1) INTERP.PAS[AL,HE]/12P/7L
1) with msg↑ do
1) if not (cmd in [movesegcmd, movehdrcmd, setccmd, setstiffcmd,
1) armmagiccmd, realcmd, vectorcmd, transcmd]) then
1) signalArm; (* tell ARM *)
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/12P/7L
2) (* with msg↑ do
2) if not ((cmd = movesegcmd) or (cmd = movehdrcmd) or
2) (cmd = setccmd) or (cmd = setstiffcmd)) then signalArm; (* tell arm *)
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/12P/31L
1) procedure getReply(sendIt: boolean);
1) var ocmd: msgtypes; b: boolean;
**** File 2) U:INTERP.PAS[AL2,RV]/12P/30L
2) procedure getReply;
2) var ocmd: msgtypes; b: boolean;
***************
**** File 1) INTERP.PAS[AL,HE]/12P/37L
1) if sendIt then sendCmd; (* send request to ARM servo *)
1) repeat
**** File 2) U:INTERP.PAS[AL2,RV]/12P/36L
2) sendCmd; (* send request to ARM servo *)
2) repeat
***************
**** File 1) INTERP.PAS[AL,HE]/12P/60L
1) bits := 0;
1) getReply(true); (* go get 1st message packet *)
1) if ok then (* check there's no error *)
**** File 2) U:INTERP.PAS[AL2,RV]/12P/59L
2) getReply; (* go get 1st message packet *)
2) if ok then (* check there's no error *)
***************
**** File 1) INTERP.PAS[AL,HE]/12P/69L
1) if version = 10 then
1) begin (* for simulation version *)
1) relTrans(tp);
1) case mech of (* get device offset *)
1) BARMDEV: i := 0;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 12,12
1) GARMDEV: i := 4;
1) RARMDEV: i := 8;
1) end;
1) ev := getEntry(0,i);
1) tp := ev↑.f↑.tdest; (* use wherever last move was to *)
1) end
1) end
**** File 2) U:INTERP.PAS[AL2,RV]/12P/67L
2) (* for simulation version *)
2) relTrans(tp);
2) case mech of (* get device offset *)
2) YARMDEV: i := 4;
2) BARMDEV: i := 0;
2) GARMDEV: i := 8;
2) RARMDEV: i := 12;
2) end;
2) ev := getEntry(0,i);
2) tp := ev↑.f↑.tdest; (* use wherever last move was to *)
2) end
***************
**** File 1) INTERP.PAS[AL,HE]/15P/165L
1) bits := 0;
1) getReply(true); (* have ARM servo read in the hand/device value *)
1) r↑.s := val;
1) r↑.ltype := svaltype;
1) if version = 10 then
1) begin (* for simulation version *)
1) case dev of (* get device offset *)
1) BHANDDEV: i := 2;
1) GHANDDEV: i := 6;
1) RHANDDEV: i := 10;
1) DRIVERDEV: i := 12;
1) VISEDEV: i := 16;
1) end;
1) ev := getEntry(0,i);
1) r↑.s := ev↑.f↑.sdest; (* use where ever last move was to *)
1) end;
1) end
**** File 2) U:INTERP.PAS[AL2,RV]/15P/165L
2) getReply; (* have ARM servo read in the hand/device value *)
2) r↑.s := val;
2) r↑.ltype := svaltype;
2) (* for simulation version *)
2) case dev of (* get device offset *)
2) YHANDDEV: i := 6;
2) BHANDDEV: i := 2;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 15,15
2) GHANDDEV: i := 10;
2) RHANDDEV: i := 14;
2) DRIVERDEV: i := 16;
2) VISEDEV: i := 20;
2) end;
2) ev := getEntry(0,i);
2) r↑.s := ev↑.f↑.sdest; (* use where ever last move was to *)
2) end
***************
**** File 1) INTERP.PAS[AL,HE]/16P/154L
1) svaltype,
1) strngtype: begin end; (* nothing to do *)
1) vectype: if v <> nil then (* check for old value *)
**** File 2) U:INTERP.PAS[AL2,RV]/16P/154L
2) (* don't need to do anything for scalars & strings *)
2) vectype: if v <> nil then (* check for old value *)
***************
**** File 1) INTERP.PAS[AL,HE]/16P/244L
1) others: begin end; (* nothing to do *)
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/16P/243L
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/17P/6L
1) if s < maxInt then
1) begin
1) si := trunc(s);
1) s := si + round(1000*(s-si))/1000;
1) end;
1) ppReal(s);
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/17P/6L
2) si := trunc(s);
2) ppReal(si + round(1000*(s-si))/1000);
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/18P/115L
1) procedure ppArmError(err: errortypes; angle: integer);
1) begin
1) if err = nopower then
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 18,18
1) begin pp20('arm power not on ',16); ppLine; end
1) else if err = devbusy then
1) begin pp20('device currently in ',20); pp5('use ',4); ppLine end
1) else
1) begin
1) case err of
1) srvdead: pp10('servo dead',10);
1) adcdead: pp10('a/d error ',9);
1) panicb: pp20('panic button pushed ',19);
1) exjtfc: begin pp20('excessive joint forc',20); ppChar('e'); end;
1) timout: pp10('time out ',8);
1) paslim: pp20('joint out of range ',18);
1) badpot: pp20('bad pot on PUMA ',15);
1) noarmsol: pp20('No arm solution ',16);
1) nocart: begin pp20('No Cartesian path ex',20); pp20('ists between these p',20);
1) pp20('ath points. ',11) end;
1) timerr: begin pp20('Specified motion tim',20); pp20('e exceeds capabiliti',20);
1) pp5('es. ',3) end;
1) durerr: begin pp20('Motion overly constr',20); pp20('ained, will ignore g',20);
1) pp20('lobal time constrain',20); pp5('t. ',2) end;
1) toolong: begin pp20('Maximum segment time',20); pp20(' allowed is 32.2 sec',20);
1) pp5('onds.',5) end;
1) featna: begin pp20('Feature not availabl',20); pp10('e yet. ',6) end;
1) others: begin pp20('Unknown error! = ',17); ppInt(ord(err)) end;
1) end;
1) badJoints(angle); (* tell which joint(s) were bad, if any *)
1) end;
1) end;
1) procedure msgDispatch; (* handles signals & movedone from ARM *)
1) var p,po: pdbp; nd,np: nodep; nvari: varidefp; i,j,k: integer; b: boolean;
1) entry: enventryp;
1) begin
**** File 2) U:INTERP.PAS[AL2,RV]/18P/115L
2) procedure msgDispatch; (* handles signals & movedone from ARM *)
2) var p: pdbp; nd: nodep;
2) begin
***************
**** File 1) INTERP.PAS[AL,HE]/18P/157L
1) barmdev: pp10('barm - ',7);
**** File 2) U:INTERP.PAS[AL2,RV]/18P/124L
2) yarmdev: pp10('yarm - ',7);
2) yhanddev: pp10('yhand - ',8);
2) barmdev: pp10('barm - ',7);
***************
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 18,18
**** File 1) INTERP.PAS[AL,HE]/18P/165L
1) others: pp20('unknown device - ',18);
1) end;
1) ppArmError(error,bits);
1) end
1) else (* *** really should check that msg type is legit, but.... *** *)
1) begin
**** File 2) U:INTERP.PAS[AL2,RV]/18P/134L
2) end;
2) case error of
2) noarmsol: begin pp20('No arm solution foun',20); pp20('d, will use approxim',20);
2) pp20('ate solution. ',13) end;
2) timerr: begin pp20('Specified motion tim',20); pp20('e is too short, will',20);
2) pp20(' try to use it anywa',20); pp5('y. ',2) end;
2) durerr: begin pp20('Motion overly constr',20); pp20('ained, will ignore g',20);
2) pp20('lobal time constrain',20); pp5('t. ',2) end;
2) toolong: begin pp20('Segment longer than ',20); pp20('32.6 seconds, will u',20);
2) pp20('se 32.6 seconds for ',20); pp10('length. ',7) end;
2) featna: begin pp20('Feature not availabl',20); pp10('e yet. ',6) end;
2) end;
2) ppLine;
2) badJoints(bits); (* tell which joint(s) were bad, if any *)
2) end
2) else
2) begin
***************
**** File 1) INTERP.PAS[AL,HE]/18P/178L
1) if curInt = nil then resched := true
1) else
1) if p↑.priority > curInt↑.priority then
1) resched := true; (* swap it in and swap us out *)
1) if cmd = movedonecmd then
**** File 2) U:INTERP.PAS[AL2,RV]/18P/158L
2) if p↑.priority > curInt↑.priority then
2) resched := true; (* swap it in and swap us out *)
2) if cmd = movedonecmd then
***************
**** File 1) INTERP.PAS[AL,HE]/18P/190L
1) next := p↑.sp; (* push it *)
**** File 2) U:INTERP.PAS[AL2,RV]/18P/168L
2) (* *** s := bits; huh??? *** *)
2) next := p↑.sp; (* push it *)
***************
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 18,18
**** File 1) INTERP.PAS[AL,HE]/18P/195L
1) else if cmd = armmagiccmd then
1) begin
1) po := curInt;
1) curInt := p; (* swap process in temporarily *)
1) j := n; (* get number of args being passed back *)
1) np := p↑.spc↑.oargs;
1) for i := 1 to j do
1) begin (* get the results of the arm magic cmd *)
1) repeat until getArm; (* read next message *)
1) b := np <> nil;
1) if b then
1) with np↑.lval↑ do
1) if ntype = leafnode then nvari := vari else nvari := arg1↑.vari;
1) nd := newNode;
1) nd↑.ntype := leafnode;
1) nd↑.ltype := svaltype; (* (so killnode will be happy) *)
1) if cmd = realcmd then
1) begin
1) nd↑.s := dur; (* copy returned scalar *)
1) if b then b := nvari↑.vtype = svaltype;
1) end
1) else if cmd = vectorcmd then
1) begin
1) nd↑.ltype := vectype;
1) nd↑.v := newVector; (* copy returned vector *)
1) with nd↑.v↑ do
1) begin val[1] := v1; val[2] := v2; val[3] := v3 end;
1) if b then b := nvari↑.vtype = vectype;
1) end
1) else if cmd = transcmd then
1) begin
1) nd↑.ltype := transtype;
1) nd↑.t := newTrans; (* copy returned trans *)
1) with nd↑.t↑ do
1) begin
1) for k := 1 to 3 do begin t[k] := val[k,1]; t[k+3] := val[k,2] end;
1) repeat until getArm; (* read second packet of trans *)
1) (* ??? should probably check that it's a transcmd, but.... ??? *)
1) for k := 1 to 3 do begin t[k] := val[k,3]; t[k+3] := val[k,4] end;
1) end;
1) if b then b := nvari↑.vtype in [rottype,transtype,frametype];
1) end
1) else
1) begin (* !!! this should never happen!!! *)
1) pp20L('Bad message received',20); pp20(' during ARM MAGIC - ',20);
1) pp10('Good Luck!',10); ppLine;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 18,18
1) b := false;
1) end;
1) if np = nil then killNode(nd) (* flush unwanted value *)
1) else
1) begin
1) if b then
1) begin (* store value away in variable *)
1) push(nd); (* first push value onto stack *)
1) with nvari↑ do
1) setVal(level,offset); (* store value into variable *)
1) end
1) else
1) begin
1) pp20L('Datatype of value re',20); pp20('turned from ARM MAGI',20);
1) pp20('C does not match ',16); ppLine;
1) killNode(nd); (* flush unwanted value *)
1) with nvari↑ do (* pop any subscripts off of stack *)
1) entry := getVar(level,offset); (* look up env entry *)
1) (* ??? should we zero it instead of leaving it unchanged ??? *)
1) end;
1) np := np↑.next;
1) end;
1) end;
1) if np <> nil then
1) begin
1) pp20L('Not enough values pa',20); pp20('ssed back from ARM M',20);
1) pp5('AGIC ',4); ppLine;
1) while np <> nil do
1) begin (* clear any subscripts off of the stack *)
1) with np↑.lval↑ do
1) if ntype <> leafnode then
1) with arg1↑.vari↑ do
1) entry := getVar(level,offset); (* look up env entry *)
1) (* ??? should we zero it instead of leaving it unchanged ??? *)
1) np := np↑.next;
1) end
1) end;
1) curInt := po; (* restore current process *)
1) end
1) else if cmd <> signalcmd then
**** File 2) U:INTERP.PAS[AL2,RV]/18P/174L
2) else if cmd <> signalcmd then
***************
**** File 1) INTERP.PAS[AL,HE]/19P/1L
1) (* aux routines: calibrate,initArms,initWorld,consDef,passConstants,flushLevel,flushAll,unwind,flushPdb,flushKids *)
1) function getPromptChar: ascii;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 19,19
1) var ch: ascii;
1) begin
1) repeat ch := getChar until ord(ch) <> lf; (* Read one character *)
1) if ord(ch) = cr then ch := ' '; (* Convert CR to space *)
1) ppChar(ch); ppOutNow; (* and echo it *)
1) if (smallA <= ord(ch)) and (ord(ch) <= smallZ) then
1) ch := chr(ord(ch)-ord(' ')); (* To upper case *)
1) getPromptChar := ch;
1) end;
1) procedure calibrate;
1) var b: boolean; i,calbits: integer; ch: ascii;
1) function bitOn(i: integer): boolean;
1) begin bitOn := true end; (* *** simulation version *** *)
1) (* begin bitOn := (msg↑.bits AND i) <> 0 end; (* *** non-standard Pascal *** *)
1) procedure whichArm;
1) begin
1) case i of (* tell which arm/hand *)
1) 1: pp5('GARM ',4);
1) 2: pp5('GHAND',5);
1) 3: pp5('RARM ',4);
1) 4: pp5('RHAND',5);
1) end;
1) end;
1) function powerOn: boolean;
1) var b: boolean;
1) begin
1) case i of
1) 1: b := bitOn(garmpower);
1) 2: b := bitOn(ghandpower);
1) 3: b := bitOn(rarmpower);
1) 4: b := bitOn(rhandpower);
1) end;
1) powerOn := b;
1) end;
1) begin (* hand-shaking code to calibrate arms *)
1) begin
1) for i := 1 to 4 do (* try to init just the PUMA's & hands for now *)
1) begin
1) repeat
1) with msg↑ do
1) begin
1) ch := ' ';
1) cmd := initarmscmd;
1) case i of
1) 1: begin dev := garmdev; calbits := garmcal end;
1) 2: begin dev := ghanddev; calbits := ghandcal end;
1) 3: begin dev := rarmdev; calbits := rarmcal end;
1) 4: begin dev := rhanddev; calbits := rhandcal end;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 19,19
1) end;
1) getReply(true); (* send over init command & wait for reply *)
1) b := ok and powerOn;
1) if not ok then
1) pp20L('Couldn''t initialize ',20)
1) else if not b then
1) pp20L('Power off for ',14);
1) if not b then begin whichArm; ppOutNow end;
1) if ok then (* try to calibrate PUMA's *)
1) begin
1) while not b do (* get power turned on *)
1) begin
1) pp20L('Turn on arm high pow',20); pp20 ('er (Type SPACE to co',20);
1) pp20 ('ntinue, any other to',20); pp10 (' abort): ',9);
1) ppOutNow;
1) ch := getPromptChar;
1) if ch <> ' ' then (* any letter will abort *)
1) begin
1) pp10L(' Aborted ',8);
1) if not bitOn(calbits) then pp20(' - not calibrated ',17);
1) ppLine;
1) ppOutNow;
1) b := true; (* so we leave power up loop *)
1) end
1) else
1) begin (* keep trying *)
1) getReply(true); (* retry the init command & check power *)
1) b := ok and powerOn;
1) end;
1) end;
1) if ch <> ' ' then b := false
1) else b := bitOn(calbits);
1) if (ch = ' ') and not b then (* if not already calibrated ... *)
1) begin
1) pp20L('Type Y to calibrate ',20); whichArm;
1) ppOutNow;
1) ch := getPromptChar;
1) if (ch = 'Y') then
1) begin
1) cmd := calibcmd;
1) getReply(true); (* go calibrate arm *)
1) b := ok;
1) if b then pp20L('Calibration complete',20)
1) else begin pp20L('Error while calibrat',20); pp5('ing ',3); end;
1) end
1) else begin pp20L(' Aborted - not calib',20); pp5('rated',5); end;
1) ppLine; ppOutNow;
1) end;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 19,19
1) end;
1) end;
1) if not b then
1) begin
1) pp20L('Type Y to try again:',20); ppchar(' '); ppOutNow;
1) ch := getPromptChar;
1) b := (ch <> 'Y');
1) end
1) until b;
1) end;
1) end;
1) end;
1) procedure initArms;
**** File 2) U:INTERP.PAS[AL2,RV]/19P/1L
2) (* aux routines: initArms,initWorld,consDef,passConstants,flushLevel,flushAll,unwind,flushPdb,flushKids *)
2) procedure initArms;
***************
**** File 1) INTERP.PAS[AL,HE]/19P/122L
1) initMsg(msg,msgp); (* connect to message buffer *)
1) (* b := startArm; (* get ARM servo running *)
1) (* *** *) b := true; (* Someday this will work... *)
1) if b then
1) begin
1) if version = 11 then
1) begin
1) pp20L('Type "Y" to calibrat',20); pp10('e arms: ',8);
1) ppOutNow;
1) if getPromptChar = 'Y' then calibrate;
1) ppLine;
1) end
1) end
1) else
1) begin (* Complain if error during startup *)
1) (* Probably should set some global flag so we don't try to talk to ARM *)
1) (* or maybe even exit the program *)
1) pp20L('Error during ARM sta',20); pp20('rtup! Arms not init',20);
1) pp10('ialized. ',8); ppLine end;
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/19P/6L
2) (* initMsg(msg,msgp); (* connect to message buffer *)
2) new(msg); msg↑.ok := true; (* for simulation version *)
2) b := startArm; (* get ARM servo running *)
2) (* hand shaking code to start up ARM servo & do any needed calibrating *)
2) end;
***************
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 19,19
**** File 1) INTERP.PAS[AL,HE]/19P/150L
1) (* ypark := tmake(vsaxwr(yhat,180.0),vmake(43.5,2.325,6.86)); *)
1) bpark := tmake(vsaxwr(yhat,180.0),vmake(43.53125,56.855,9.95875));
**** File 2) U:INTERP.PAS[AL2,RV]/19P/21L
2) ypark := tmake(vsaxwr(yhat,180.0),vmake(43.5,2.325,6.86));
2) bpark := tmake(vsaxwr(yhat,180.0),vmake(43.53125,56.855,9.95875));
***************
**** File 1) INTERP.PAS[AL,HE]/19P/154L
1) bpark↑.refcnt := 1000;
**** File 2) U:INTERP.PAS[AL2,RV]/19P/25L
2) ypark↑.refcnt := 1000;
2) bpark↑.refcnt := 1000;
***************
**** File 1) INTERP.PAS[AL,HE]/19P/159L
1) procedure passConstants(var x,y,z,nv: vectorp; var b,g,r,nt: transp);
1) begin
1) x := xhat; y := yhat; z := zhat; nv := nilvect;
1) b := bpark; g := gpark; r := rpark; nt := niltrans;
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/19P/31L
2) procedure passConstants(var x,y,z,nv: vectorp; var b,yp,g,r,nt: transp);
2) begin
2) x := xhat; y := yhat; z := zhat; nv := nilvect;
2) b := bpark; yp := ypark; g := gpark; r := rpark; nt := niltrans;
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/19P/197L
1) b := v↑.offset in [0,2,4,6,8,10,12,16];
1) (* offsets: arms: 0,4,8 hands: 2,6,10 driver/vise: 12,16 *)
1) if b then e↑.etype := frametype; (* so we get a frame for scalar devices *)
**** File 2) U:INTERP.PAS[AL2,RV]/19P/69L
2) b := v↑.offset in [0,2,4,6,8,10,12,14,16,20];
2) (* offsets: arms: 0,4,8,12 hands: 2,6,10,14 driver/vise: 16,20 *)
2) if b then e↑.etype := frametype; (* so we get a frame for scalar devices *)
***************
**** File 1) INTERP.PAS[AL,HE]/19P/214L
1) 0: mech := BARMDEV; (* barm *)
1) 1: mech := BHANDDEV; (* bhand *)
1) 2: mech := GARMDEV; (* garm *)
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 19,19
1) 3: mech := GHANDDEV; (* ghand *)
1) 4: mech := RARMDEV; (* rarm *)
1) 5: mech := RHANDDEV; (* rhand *)
1) 6: mech := DRIVERDEV; (* driver *)
1) 8: mech := VISEDEV; (* vise *)
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/19P/86L
2) 2: mech := YARMDEV; (* yarm *)
2) 3: mech := YHANDDEV; (* yhand *)
2) 0: mech := BARMDEV; (* barm *)
2) 1: mech := BHANDDEV; (* bhand *)
2) 10: mech := VISEDEV; (* vise *)
2) 8: mech := DRIVERDEV; (* driver *)
2) 4: mech := GARMDEV; (* garm *)
2) 5: mech := GHANDDEV; (* ghand *)
2) 6: mech := RARMDEV; (* rarm *)
2) 7: mech := RHANDDEV; (* rhand *)
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/19P/227L
1) speedfactor := getEntry(0,20);
1) e := getEntry(0,4); (* offset for garm = 4 *)
1) garm := e↑.f; (* remember frame used for green arm *)
1) curInt := getPdb;
1) escInit(escapeI); (* enable escape-I interrupts *)
1) if version = 11 then
1) begin
1) (* rewrite(talk,'tt3:'); (* *** *) (* speech synthesizer is on tt3: *)
1) writeln(talk,chr(5),'20P'); (* Set up standard AL voice (a la jjc) *)
1) end;
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/19P/101L
2) speedfactor := getEntry(0,24);
2) e := getEntry(0,0); (* offset for barm = 0 *)
2) barm := e↑.f; (* remember frame used for blue arm *)
2) curInt := getPdb;
2) escInit(escapeI); (* enable escape-I interrupts *)
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/20P/10L
1) begin
1) pdb↑.mech := curInt↑.mech; (* inherit device being controlled *)
1) if running then enabled := true (* if currently running, re-enable it *)
**** File 2) U:INTERP.PAS[AL2,RV]/20P/10L
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 20,20
2) if running then enabled := true (* if currently running, re-enable it *)
***************
**** File 1) INTERP.PAS[AL,HE]/20P/22L
1) end;
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/20P/20L
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/21P/42L
1) if (op < specop) or (op = adcop) or (op = jointop) then
1) begin (* if it's not a special op *)
1) res := newNode;
**** File 2) U:INTERP.PAS[AL2,RV]/21P/42L
2) if (op < specop) or (op = adcop) then (* make sure it's not a special op *)
2) begin
2) res := newNode;
***************
**** File 1) INTERP.PAS[AL,HE]/21P/51L
1) case op of (* assumes correct args on stack *)
1) (* relations *)
**** File 2) U:INTERP.PAS[AL2,RV]/21P/51L
2) case op of (* assumes correct args on stack *)
2) (* relations *)
***************
**** File 1) INTERP.PAS[AL,HE]/21P/146L
1) if ord(ch) >= smallA then
1) ch := chr(ord(ch) - ord(' ')); (* make upper case *)
1) if (ch = 'Y') or (ch = 'N') then
**** File 2) U:INTERP.PAS[AL2,RV]/21P/146L
2) if ord(ch) > 140B then ch := chr(ord(ch)-40B); (* make upper case *)
2) if (ch = 'Y') or (ch = 'N') then
***************
**** File 1) INTERP.PAS[AL,HE]/21P/227L
1) getReply(true); (* have ARM servo read it in *)
1) res↑.s := val; (* store result away *)
**** File 2) U:INTERP.PAS[AL2,RV]/21P/226L
2) getReply; (* have ARM servo read it in *)
2) res↑.s := val; (* store result away *)
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 21,21
***************
**** File 1) INTERP.PAS[AL,HE]/21P/245L
1) jointop: with msg↑ do
1) begin
1) cmd := wherecmd;
1) bits := joint1cb+joint2cb+joint3cb+joint4cb+joint5cb+joint6cb;
1) with arg1↑.vari↑ do
1) ep := getVar(level,offset); (* environment entry for device *)
1) dev := ep↑.f↑.mech; (* don't need to check it's a valid device *)
1) getReply(true); (* have ARM servo read it in *)
1) n1 := getNval(arg2↑.lval,b1); (* now see which joint is wanted *)
1) i := round(n1↑.s); (* get joint # *)
1) if (i < 0) or (6 < i) then (* bad joint # *)
1) begin
1) pp20L('Joint number out of ',20); pp20('range - using jt 1 ',18);
1) ppLine;
1) i := 1;
1) end;
1) res↑.s := t[i]; (* fetch & store result away *)
1) end;
1) (* special *)
**** File 2) U:INTERP.PAS[AL2,RV]/21P/244L
2) (* special *)
***************
**** File 1) INTERP.PAS[AL,HE]/21P/344L
1) if (op < ioop) or (op = adcop) or (op = jointop) then
1) push(res); (* save result on stack *)
1) if b1 then relNode(n1); (* release nodes when done with them *)
**** File 2) U:INTERP.PAS[AL2,RV]/21P/324L
2) if op < ioop then push(res); (* save result on stack *)
2) if b1 then relNode(n1); (* release nodes when done with them *)
***************
**** File 1) INTERP.PAS[AL,HE]/22P/8L
1) if version = 10 then garm↑.tdest := gpark; (* for 10 version *)
1) curInt↑.spc := curInt↑.spc↑.pcode;
**** File 2) U:INTERP.PAS[AL2,RV]/22P/8L
2) barm↑.tdest := bpark; (* for 10 version *)
2) curInt↑.spc := curInt↑.spc↑.pcode;
***************
**** File 1) INTERP.PAS[AL,HE]/34P/2L
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 34,34
1) const smallP = 112; (* Lowercase p *)
1) var ch: ascii; b: boolean;
**** File 2) U:INTERP.PAS[AL2,RV]/34P/2L
2) var ch: ascii; b: boolean;
***************
**** File 1) INTERP.PAS[AL,HE]/34P/32L
1) if (inputLine[1] = chr(smallP)) or (inputLine[1] = 'P') then
1) begin
**** File 2) U:INTERP.PAS[AL2,RV]/34P/31L
2) if (inputLine[1] = chr(160B)) or (inputLine[1] = 'P') then
2) begin
***************
**** File 1) INTERP.PAS[AL,HE]/37P/1L
1) procedure doSay;
1) var n,np: nodep; b: boolean;
1) procedure sayInt(i: integer);
1) var j: integer; n: array [1..9] of integer;
1) begin
1) for j := 1 to 9 do (* get individual digits *)
1) begin n[j] := i mod 10; i := i div 10 end;
1) j := 9;
1) while (j > 1) and (n[j] = 0) do j := j - 1; (* ignore leading zeros *)
1) for i := j downto 1 do
1) if version = 11 then write(talk,chr(ord('0')+n[i])) (* say digit *)
1) else ppChar(chr(ord('0')+n[i])); (* print it *)
1) end;
1)
1) procedure saySval(s: real);
1) var si: real; ip,fp: integer;
1) begin
1) if s < maxInt then
1) begin
1) si := trunc(s);
1) s := si + round(1000*(s-si))/1000;
1) ip := trunc(s);
1) fp := trunc(1000*(s-ip));
1) sayInt(ip); (* say integer part *)
1) if fp > 0 then
1) begin (* say fractional part too *)
1) if version = 11 then write(talk,' point ')
1) else pp10(' point ',7);
1) sayInt(fp);
1) end;
1) end
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 37,37
1) else
1) begin (* it's a bignum *)
1) fp := 0;
1) repeat fp := fp + 1; s := s / 10 until s <= maxint; (* scale it down *)
1) sayInt(trunc(s)); (* say significant digits *)
1) for ip := 1 to fp do (* now the trailing zeros *)
1) if version = 11 then write(talk,'0') else ppChar('0');
1) end;
1) if version = 11 then write(talk,' ,, ') (* add a small pause *)
1) else ppChar(' ');
1) end;
1) procedure sayVec(v: vectorp);
1) var i: integer;
1) begin
1) if version = 11 then write(talk,' vector ')
1) else pp10('vector ',7);
1) with v↑ do
1) for i := 1 to 3 do
1) begin
1) saySval(val[i]);
1) end;
1) if version = 11 then write(talk,' ,, '); (* add a small pause *)
1) end;
1) procedure sayTrans(t: transp);
1) var i: integer; v: vectorp;
1) begin
1) with t↑ do
1) begin
1) refcnt := refcnt + 1;
1) if version = 11 then write(talk,' trans rot ')
1) else pp10('trans rot ',10);
1) v := taxis(t); sayVec(v); relVector(v);
1) saySval(tmagn(t));
1) if version = 11 then write(talk,' , vector ')
1) else pp10(' , vector ',10);
1) for i := 1 to 3 do
1) begin
1) saySval(val[i,4]);
1) end;
1) if version = 11 then write(talk,' ,, '); (* add a small pause *)
1) refcnt := refcnt - 1;
1) end;
1) end;
1) procedure sayStrng(length: integer; s: strngp);
1) var i,j: integer; cntl: boolean; ch: ascii;
1) begin
1) j := 1;
1) cntl := false;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 37,37
1) for i := 1 to length do
1) begin
1) ch := s↑.ch[j];
1) if cntl then
1) begin (* make it a control char *)
1) if ord(ch) >= smallA then
1) ch := chr(ord(ch) - ord(' ')); (* convert to uppercase *)
1) if version = 11 then write(talk,chr(ord(ch) - ord('@')))
1) else begin ppChar('↑'); ppChar(ch) end;
1) cntl := false;
1) end
1) else if ch = '\' then cntl := true
1) else
1) if version = 11 then write(talk,ch) else ppChar(ch);
1) if j = 10 then begin j := 1; s := s↑.next; end
1) else j := j + 1;
1) end;
1) end;
1) begin
1) with curInt↑ do
1) begin (* say whatever user wants us to *)
1) n := spc↑.plist;
1) if version = 10 then
1) if n <> nil then pp10l('Speaking: ',10);
1) while n <> nil do (* say everything on the list *)
1) begin
1) np := getNval(n↑.lval,b);
1) if np <> nil then
1) begin
1) with np↑ do
1) case ltype of
1) svaltype: saySval(s);
1) vectype: sayVec(v);
1) transtype: sayTrans(t);
1) strngtype: sayStrng(length,str);
1) end;
1) if b then killNode(np); (* flush used stack entry *)
1) end;
1) n := n↑.next;
1) end;
1) if spc↑.plist <> nil then
1) begin
1) if version = 11 then
1) begin writeln(talk); break(talk) end (* say it now *)
1) else ppLine;
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/37P/1L
2) procedure doAssign;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 37,37
2) var ev: enventryp; res: nodep;
2) begin
2) with curInt↑.spc↑.what↑ do
2) begin
2) if ntype = leafnode then
2) with vari↑ do setVal(level,offset) (* store into simple variable *)
2) else
2) case op of (* see what type of store we're to do *)
2) arefop: with arg1↑.vari↑ do setVal(level,offset); (* store into array var *)
2) deproachop: begin (* any subscripts & deproach value on stack *)
2) ev := gtVarn(curInt↑.spc↑.what); (* access variable *)
2) res := pop; (* get deproach value *)
2) (* check we've really got a frame? *)
2) ev↑.f↑.fdepr := res↑.t; (* store it away *)
2) relNode(res);
2) end;
2) tposop,
2) torientop: begin
2) with arg1↑ do
2) if ntype = leafnode then
2) with vari↑ do setVal(level,offset) (* simple variable *)
2) else
2) with arg1↑.vari↑ do setVal(level,offset); (* array variable *)
2) end;
2) end;
2) curInt↑.mode := 0;
2) curInt↑.spc := curInt↑.spc↑.next; (* move on to next statement *);
2) end;
2) end;
2) procedure doSignal;
2) var ev: enventryp; p, pt: pdbp; st: statementp;
2) begin
2) with curInt↑ do
2) begin
2) st := spc;
2) spc := spc↑.next; (* advance our pc now before possibly swapping ourself out *)
2) mode := 0;
2) if singleThreadMode then
2) begin
2) pp20L('Would signal event: ',20); prntVar(st↑.event);
2) end
2) else if st↑.event <> nil then
2) begin
2) ev := gtVarn(st↑.event); (* access variable *)
2) ev↑.evt↑.count := ev↑.evt↑.count + 1;
2) p := ev↑.evt↑.waitlist; (* get pdb of process to schedule (if any) *)
2) if p <> nil then
2) begin
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 37,37
2) ev↑.evt↑.waitlist := p↑.next; (* remove node from waitlist *)
2) if p↑.priority > priority then
2) begin (* swap it in and swap us out *)
2) p↑.status := nowrunning;
2) pt := curInt;
2) curInt := p;
2) p := pt;
2) end;
2) p↑.status := runqueue;
2) addPdb(activeInts,p); (* add whoever to active process list *)
2) end;
2) end;
2) end;
2) end;
2) procedure doWait;
2) var ev: enventryp; p: pdbp; st: statementp; b: boolean;
2) begin
2) with curInt↑ do
2) if singleThreadMode then
2) if mode = 1 then
2) begin
2) if readQueue = nil then b := true
2) else b := (readQueue↑.priority div 10) < (curInt↑.priority div 10);
2) if b then
2) begin (* first time through *)
2) pp20L('Would wait for event',20); pp5(': ',2); prntVar(spc↑.event);
2) mode := 2;
2) doPrompt; (* now have user type a "P" to proceed *)
2) end
2) else sleep(60) (* wait a sec for other input to finish *)
2) end
2) else doPrompt
2) else
2) begin
2) st := spc;
2) spc := spc↑.next; (* advance our pc now before maybe swapping out *)
2) mode := 0;
2) if st↑.event <> nil then
2) begin
2) ev := gtVarn(st↑.event); (* access variable *)
2) ev↑.evt↑.count := ev↑.evt↑.count - 1;
2) if ev↑.evt↑.count < 0 then (* hasn't been signalled yet, need to wait *)
2) begin
2) curInt↑.status := eventqueue;
2) addPdb(ev↑.evt↑.waitlist,curInt); (* add us to wait list *)
2) curInt := nil; (* swap in someone else *)
2) resched := true;
2) end;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 37,37
2) end;
2) end;
2) end;
2) procedure doEnable;
2) begin
2) with curInt↑ do
2) begin
2) if spc↑.cmonlab = nil then
2) if cm <> nil then cm↑.enabled := true (* re-enabling this cmon *)
2) else
2) begin
2) pp20L('No cmon to enable! ',18); ppLine;
2) end
2) else
2) begin
2) with spc↑.cmonlab↑.s↑.cdef↑ do
2) cmonEnable(getVar(level,offset)); (* enable cmon control block *)
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/38P/1L
1) procedure doAssign;
1) var ev: enventryp; res: nodep;
1) begin
1) with curInt↑.spc↑.what↑ do
1) begin
1) if ntype = leafnode then
1) with vari↑ do setVal(level,offset) (* store into simple variable *)
1) else
1) case op of (* see what type of store we're to do *)
1) arefop: with arg1↑.vari↑ do setVal(level,offset); (* store into array var *)
1) deproachop: begin (* any subscripts & deproach value on stack *)
1) ev := gtVarn(curInt↑.spc↑.what); (* access variable *)
1) res := pop; (* get deproach value *)
1) (* check we've really got a frame? *)
1) ev↑.f↑.fdepr := res↑.t; (* store it away *)
1) relNode(res);
1) end;
1) tposop,
1) torientop: begin
1) with arg1↑ do
1) if ntype = leafnode then
1) with vari↑ do setVal(level,offset) (* simple variable *)
1) else
1) with arg1↑.vari↑ do setVal(level,offset); (* array variable *)
1) end;
1) end;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 38,41
1) curInt↑.mode := 0;
1) curInt↑.spc := curInt↑.spc↑.next; (* move on to next statement *);
1) end;
1) end;
1) procedure doSignal;
1) var ev: enventryp; p, pt: pdbp; st: statementp;
1) begin
**** File 2) U:INTERP.PAS[AL2,RV]/41P/1L
2) procedure doDisable;
2) var e: enventryp;
2) begin
***************
**** File 1) INTERP.PAS[AL,HE]/39P/6L
1) st := spc;
1) spc := spc↑.next; (* advance our pc now before possibly swapping ourself out *)
1) mode := 0;
1) if singleThreadMode then
1) begin
1) pp20L('Would signal event: ',20); prntVar(st↑.event);
1) end
1) else if st↑.event <> nil then
1) begin
1) ev := gtVarn(st↑.event); (* access variable *)
1) ev↑.evt↑.count := ev↑.evt↑.count + 1;
1) p := ev↑.evt↑.waitlist; (* get pdb of process to schedule (if any) *)
1) if p <> nil then
1) begin
1) ev↑.evt↑.waitlist := p↑.next; (* remove node from waitlist *)
1) if p↑.priority > priority then
1) begin (* swap it in and swap us out *)
1) p↑.status := nowrunning;
1) pt := curInt;
1) curInt := p;
1) p := pt;
1) end;
1) p↑.status := runqueue;
1) addPdb(activeInts,p); (* add whoever to active process list *)
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/41P/6L
2) if spc↑.cmonlab = nil then
2) if cm <> nil then cm↑.enabled := false (* disabling this cmon *)
2) else
2) begin
2) pp20L('No cmon to disable! ',19); ppLine;
2) end
2) else
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 39,41
2) begin
2) with spc↑.cmonlab↑.s↑.cdef↑ do
2) e := getVar(level,offset); (* get cmon control block *)
2) if e↑.c↑.running then sleep(30) (* if running wait for it to finish *)
2) else
2) begin
2) cmonDisable(e↑.c); (* disable it *)
2) mode := 0;
2) spc := spc↑.next;
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/40P/1L
1) procedure doWait;
1) var ev: enventryp; p: pdbp; st: statementp; b: boolean;
1) begin
1) with curInt↑ do
1) if singleThreadMode then
1) if mode = 1 then
1) begin
1) if readQueue = nil then b := true
1) else b := (readQueue↑.priority div 10) < (curInt↑.priority div 10);
1) if b then
1) begin (* first time through *)
1) pp20L('Would wait for event',20); pp5(': ',2); prntVar(spc↑.event);
1) mode := 2;
1) doPrompt; (* now have user type a "P" to proceed *)
1) end
1) else sleep(60) (* wait a sec for other input to finish *)
1) end
1) else doPrompt
1) else
1) begin
1) st := spc;
1) spc := spc↑.next; (* advance our pc now before maybe swapping out *)
1) mode := 0;
1) if st↑.event <> nil then
1) begin
1) ev := gtVarn(st↑.event); (* access variable *)
1) ev↑.evt↑.count := ev↑.evt↑.count - 1;
1) if ev↑.evt↑.count < 0 then (* hasn't been signalled yet, need to wait *)
1) begin
1) curInt↑.status := eventqueue;
1) addPdb(ev↑.evt↑.waitlist,curInt); (* add us to wait list *)
1) curInt := nil; (* swap in someone else *)
1) resched := true;
1) end;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 40,42
1) end;
1) end;
1) end;
1) procedure doEnable;
1) begin
1) with curInt↑ do
1) begin
1) if spc↑.cmonlab = nil then
1) if cm <> nil then cm↑.enabled := true (* re-enabling this cmon *)
1) else
1) begin
1) pp20L('No cmon to enable! ',18); ppLine;
1) end
1) else
1) begin
1) with spc↑.cmonlab↑.s↑.cdef↑ do
1) cmonEnable(getVar(level,offset)); (* enable cmon control block *)
1) end;
1) mode := 0;
1) spc := spc↑.next;
1) end;
1) end;
1) procedure doDisable;
1) var e: enventryp;
1) begin
1) with curInt↑ do
1) begin
1) if spc↑.cmonlab = nil then
1) if cm <> nil then cm↑.enabled := false (* disabling this cmon *)
1) else
1) begin
1) pp20L('No cmon to disable! ',19); ppLine;
1) end
1) else
1) begin
1) with spc↑.cmonlab↑.s↑.cdef↑ do
1) e := getVar(level,offset); (* get cmon control block *)
1) if e↑.c↑.running then sleep(30) (* if running wait for it to finish *)
1) else
1) begin
1) cmonDisable(e↑.c); (* disable it *)
1) mode := 0;
1) spc := spc↑.next;
1) end;
1) end;
1) end;
1) end;
1) (* affixment auxiliary routines: affixaux, unfixaux & unfix *)
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 40,42
**** File 2) U:INTERP.PAS[AL2,RV]/42P/1L
2) (* affixment auxiliary routines: affixaux, unfixaux & unfix *)
***************
**** File 1) INTERP.PAS[AL,HE]/46P/25L
1) if mech = nil then i := GARMDEV (* default to green arm *)
1) else if mech↑.ftype then
1) if mech↑.dev <> nil then i := mech↑.dev↑.mech
1) else i := GARMDEV (* default to green arm *)
1) else i := mech↑.mech;
**** File 2) U:INTERP.PAS[AL2,RV]/45P/25L
2) if mech = nil then i := BARMDEV (* default to blue arm *)
2) else if mech↑.ftype then
2) if mech↑.dev <> nil then i := mech↑.dev↑.mech
2) else i := BARMDEV (* default to blue arm *)
2) else i := mech↑.mech;
***************
**** File 1) INTERP.PAS[AL,HE]/46P/43L
1) else if (ntype = viaptnode) or (ntype = byptnode) then st := vcode
1) else if (ntype = deprnode) or (ntype = apprnode) then st := code;
**** File 2) U:INTERP.PAS[AL2,RV]/45P/43L
2) else if ntype = viaptnode then st := vcode
2) else if (ntype = deprnode) or (ntype = apprnode) then st := code;
***************
**** File 1) INTERP.PAS[AL,HE]/46P/69L
1) else if (ntype = viaptnode) or (ntype = byptnode) then st := vcode
1) else if (ntype = deprnode) or (ntype = apprnode) then st := code;
**** File 2) U:INTERP.PAS[AL2,RV]/45P/69L
2) else if ntype = viaptnode then st := vcode
2) else if (ntype = deprnode) or (ntype = apprnode) then st := code;
***************
**** File 1) INTERP.PAS[AL,HE]/46P/86L
1) else i := 9 (* assume garm *)
1) else i := mech↑.vari↑.offset + 1;
1) if version = 10 then
1) begin (* for simulation version *)
1) push(newNode);
1) with sp↑ do
1) begin ntype := leafnode; ltype := svaltype; s := 0.0 end;
1) end;
1) errbits := round(sp↑.s); (* remember error value *)
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 46,45
**** File 2) U:INTERP.PAS[AL2,RV]/45P/86L
2) else i := 1 (* assume barm *)
2) else i := mech↑.vari↑.offset + 1;
2) push(newNode); (* *** for SAIL simulation version *** *)
2) with sp↑ do (* *** " " *** *)
2) begin ntype := leafnode; ltype := svaltype; s := 0.0 end; (* *** " " *** *)
2) errbits := round(sp↑.s); (* remember error value *)
***************
**** File 1) INTERP.PAS[AL,HE]/46P/122L
1) if mech = nil then fr := garm
1) else if mech↑.ftype then (* first tell what device *)
1) if mech↑.dev <> nil then fr := mech↑.dev
1) else fr := garm
1) else fr := mech;
**** File 2) U:INTERP.PAS[AL2,RV]/45P/119L
2) if mech = nil then fr := barm
2) else if mech↑.ftype then (* first tell what device *)
2) if mech↑.dev <> nil then fr := mech↑.dev
2) else fr := barm
2) else fr := mech;
***************
**** File 1) INTERP.PAS[AL,HE]/46P/129L
1) ppArmError(errval,angle);
1) pp20L('"P" to proceed, "R" ',20); pp20('to retry the motion ',19);
**** File 2) U:INTERP.PAS[AL2,RV]/45P/126L
2) if errval = nopower then
2) begin
2) pp20('arm interface power ',20); pp20('supply turned off ',17);
2) pp20L(' (check joint br',20); pp20('ake switches) ',13);
2) ppLine;
2) end
2) else if errval = devbusy then
2) begin pp20('device currently in ',20); pp5('use ',4) end
2) else
2) begin
2) case errval of
2) srvdead: pp10('servo dead',10);
2) adcdead: pp10('a/d error ',9);
2) panicb: pp20('panic button pushed ',19);
2) exjtfc: begin pp20('excessive force enco',20); pp10('untered ',7); end;
2) timout: pp10('time out ',8);
2) paslim: pp20('stop limit exceeded ',20);
2) noarmsol: begin pp20('no arm solution whil',20); pp10('e servoing',10) end;
2) end;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 46,45
2) badJoints(angle); (* tell which joint(s) were bad, if any *)
2) end;
2) pp20L('"P" to proceed, "R" ',20); pp20('to retry the motion ',19);
***************
**** File 1) INTERP.PAS[AL,HE]/46P/152L
1) var ch: ascii; ev: eventp; mechbits,i: integer; fr: framep;
1) cl: nodep; b: boolean;
1) begin
**** File 2) U:INTERP.PAS[AL2,RV]/45P/169L
2) var ch: ascii; ev: eventp; mechbits: integer; fr: framep;
2) begin
***************
**** File 1) INTERP.PAS[AL,HE]/46P/160L
1) if ord(ch) >= smallA then
1) ch := chr(ord(ch) - ord(' ')); (* convert to uppercase *)
1) if ch = 'B' then running := false (* break to debugger, proceed will retry *)
**** File 2) U:INTERP.PAS[AL2,RV]/45P/176L
2) if ord(ch) > 140B then ch := chr(ord(ch)-40B); (* convert to uppercase *)
2) if ch = 'B' then running := false (* break to debugger, proceed will retry *)
***************
**** File 1) INTERP.PAS[AL,HE]/46P/173L
1) b := true;
1) cl := spc↑.clauses;
1) while (cl <> nil) and b do (* see if destination specified *)
1) begin b := cl↑.ntype = destnode; cl := cl↑.next end;
1) with msg↑ do
**** File 2) U:INTERP.PAS[AL2,RV]/45P/188L
2) with msg↑ do
***************
**** File 1) INTERP.PAS[AL,HE]/46P/181L
1) bits := Nullingcb + Durlbcb; (* nonulling & duration *)
1) evt := ev;
**** File 2) U:INTERP.PAS[AL2,RV]/45P/192L
2) bits := NULLINGCB + DURLBCB; (* nonulling & duration *)
2) evt := ev;
***************
**** File 1) INTERP.PAS[AL,HE]/46P/185L
1) if mech = nil then fr := garm
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 46,45
1) else if mech↑.ftype then
1) if mech↑.dev <> nil then fr := mech↑.dev
1) else fr := garm
1) else fr := mech;
**** File 2) U:INTERP.PAS[AL2,RV]/45P/196L
2) if mech = nil then fr := barm
2) else if mech↑.ftype then
2) if mech↑.dev <> nil then fr := mech↑.dev
2) else fr := barm
2) else fr := mech;
***************
**** File 1) INTERP.PAS[AL,HE]/46P/195L
1) if not b then bits := Destptcb else bits := Byptcb + Destptcb;
1) sendTrans(fr↑.tdest); (* send over destination point *)
1) end
1) else if spc↑.stype = jtmovetype then
1) begin
1) n := 1; (* only one segment *)
1) i := round(fr↑.tdest↑.val[1,2]); (* get number of joint *)
1) case i of
1) 1: bits := Nullingcb + Durlbcb + Joint1cb;
1) 2: bits := Nullingcb + Durlbcb + Joint2cb;
1) 3: bits := Nullingcb + Durlbcb + Joint3cb;
1) 4: bits := Nullingcb + Durlbcb + Joint4cb;
1) 5: bits := Nullingcb + Durlbcb + Joint5cb;
1) 6: bits := Nullingcb + Durlbcb + Joint6cb;
1) end;
1) sendCmd; (* send over move header *)
1) cmd := movesegcmd;
1) if not b then bits := Destptcb else bits := Byptcb + Destptcb;
1) sendCmd;
1) t[i] := fr↑.tdest↑.val[1,1]; (* send over joint value *)
1) sendCmd;
1) end
**** File 2) U:INTERP.PAS[AL2,RV]/45P/206L
2) bits := DESTPTCB;
2) sendTrans(fr↑.tdest); (* send over destination point *)
2) end
***************
**** File 1) INTERP.PAS[AL,HE]/46P/224L
1) (* *** need to set Durlbcb too??? *** *)
1) end
1) else
1) bits := bits + Destptcb; (* indicate specifying opening *)
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 46,45
1) if mechbits = VISEDEV then
**** File 2) U:INTERP.PAS[AL2,RV]/45P/216L
2) (* *** need to set DURLBCB too??? *** *)
2) end
2) else
2) bits := bits + DESTPTCB; (* indicate specifying opening *)
2) if mechbits = VISEDEV then
***************
**** File 1) INTERP.PAS[AL,HE]/46P/236L
1) if version = 11 then
1) begin
1) if mechbits <> VISEDEV then signalArm; (* start it up *)
1) curInt↑.status := devicewait;
1) curInt := nil;
1) resched := true; (* swap someone else in *)
1) end
1) else freeEvent(ev); (* sim ver *)
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/45P/228L
2) (* if mechbits <> VISEDEV then signalArm; (* start it up *)
2) (* curInt↑.status := devicewait; (* don't for simulation version *)
2) (* curInt := nil;
2) (* resched := true; (* swap someone else in *)
2) freeEvent(ev); (* sim ver *)
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/47P/2L
1) var e: enventryp; n: nodep; b: boolean; val: nodep; r: real; fbits,i: integer;
1) sst: statementp;
1) begin
**** File 2) U:INTERP.PAS[AL2,RV]/46P/2L
2) var e: enventryp; n: nodep; b: boolean; val: nodep; r: real; fbits: integer;
2) begin
***************
**** File 1) INTERP.PAS[AL,HE]/47P/46L
1) with spc↑.conclusion↑ do
1) if stype = stoptype then
1) begin (* set FSTOP bit if no explicit frame is being stopped *)
1) if cf = nil then fbits := fbits + FSTOP
1) else if cf↑.ntype = leafnode then
1) begin (* need to check if same device as current mech *)
1) e := gtVarn(cf); (* get variable frame *)
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 47,46
1) if e↑.etype = frametype then
1) begin
1) if e↑.f = nil then i := GARMDEV (* default to green arm *)
1) else with e↑.f↑ do
1) if ftype then
1) if dev <> nil then i := dev↑.mech
1) else i := GARMDEV (* default to green arm *)
1) else i := mech;
1) if i = getMechBits then fbits := fbits + FSTOP;
1) end
1) end;
1) (* ** can't check if array ref since subscripts aren't on stack ** *)
1) end
1) else if stype = blocktype then
1) if bcode↑.stype = stoptype then
1) if bcode↑.cf = nil then fbits := fbits + FSTOP;
1) cm↑.fbits := fbits; (* remember bits in cmoncb *)
**** File 2) U:INTERP.PAS[AL2,RV]/46P/45L
2) (* deal with which arm here *) fbits := fbits + BLUARM; (* for now *)
2) cm↑.fbits := fbits; (* remember bits in cmoncb *)
***************
**** File 1) INTERP.PAS[AL,HE]/47P/73L
1) dev := getMechbits; (* deal with which arm here *)
1) bits := fbits;
**** File 2) U:INTERP.PAS[AL2,RV]/46P/50L
2) bits := fbits;
***************
**** File 1) INTERP.PAS[AL,HE]/48P/2L
1) var appr,depr,dest,bydest,arrv,wobble,sfac,dur,ffr,stiff,gather,zwrist,n: nodep;
1) elbow,shoulder,flip,load,linear,cl,val,val1,val2: nodep;
1) t,tl,tb: transp; st: statementp; e: enventryp; fr: framep;
1) r: real; fbits,nsegs,mechbits,i,j,cmForce,useForce,jtnum: integer;
1) b,b1,b2,nulling,apprp,deprp,jointp: boolean; ev: eventp;
1) function getLoc(n: nodep): transp;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/2L
2) var appr,depr,dest,arrv,wobble,sfac,dur,ffr,stiff,gather,zwrist,n: nodep;
2) cl,val,val1,val2: nodep; t,tl,tb: transp; st: statementp; e: enventryp;
2) r: real; fbits,nsegs,mechbits,i,cmForce,useForce: integer; fr: framep;
2) b,b1,b2,nulling,apprp,deprp: boolean; ev: eventp;
2) function getLoc(n: nodep): transp;
***************
**** File 1) INTERP.PAS[AL,HE]/48P/14L
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
1) (* if t <> nil then tp := ttmul(t,tp); now done by ARM *)
1) getLoc := tp;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/13L
2) if t <> nil then tp := ttmul(t,tp);
2) getLoc := tp;
***************
**** File 1) INTERP.PAS[AL,HE]/48P/25L
1) (* if t <> nil then tp := ttmul(t,tp); now done by ARM *)
1) getDepr := tp;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/24L
2) tp := ttmul(tb,tp); (* shift to proper coord sys *)
2) if t <> nil then tp := ttmul(t,tp);
2) getDepr := tp;
***************
**** File 1) INTERP.PAS[AL,HE]/48P/39L
1) msg↑.bits := msg↑.bits + Codecb;
1) end;
1) end;
1) procedure sendJt(r: real; n: nodep; b: boolean);
1) begin
1) sendCmd;
1) msg↑.t[jtnum] := r; (* send over joint value *)
1) if b then relNode(n);
1) sendCmd;
1) end;
1) procedure setConfigBits;
1) var cbits: integer;
1) begin
1) cbits := 0;
1) if elbow <> nil then
1) if elbow↑.notp then cbits := elbowcb + upcb else cbits := elbowcb;
1) if shoulder <> nil then
1) if shoulder↑.notp then cbits := cbits + shouldercb + rightcb
1) else cbits := cbits + shouldercb;
1) if flip <> nil then
1) if flip↑.notp then cbits := cbits + wristcb + flipcb
1) else cbits := cbits + wristcb;
1) with msg↑ do bits := bits + cbits;
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/39L
2) msg↑.bits := msg↑.bits + CODECB;
2) end;
2) end;
***************
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
**** File 1) INTERP.PAS[AL,HE]/48P/70L
1) jointp := st↑.stype = jtmovetype; (* is it a joint motion? *)
1) case mode of
1) 1: begin (* set up force system, enable all cmons *)
1) if not jointp then
1) begin
1) e := gtVarn(spc↑.cf); (* remember what we're moving *)
1) mech := e↑.f;
1) mechbits := getMechbits;
1) if mech↑.ftype then (* check it's a device *)
1) if mech↑.dev = nil then
1) begin (* yow! frame that's not affixed to an arm *)
1) pp20L('Control frame not af',20); pp20('fixed to any device:',20);
1) pp20(' Assuming garm ',14); ppLine;
1) end;
1) end
1) else
1) begin
1) with st↑.cf↑.arg1↑.vari↑ do
1) e := getVar(level,offset);
1) mech := e↑.f; (* remember what we're moving *)
1) mechbits := e↑.f↑.mech;
1) val := getNval(st↑.cf↑.arg2↑.lval,b); (* now see which joint is wanted *)
1) i := round(val↑.s); (* get joint # *)
1) if (i < 0) or (6 < i) then (* bad joint # *)
1) begin
1) pp20L('Joint number out of ',20); pp20('range - using jt 1 ',18);
1) ppLine;
1) i := 1;
1) end;
1) if not b then
1) begin val := newNode; val↑.ntype := leafnode; val↑.ltype := svaltype end;
1) val↑.s := i; (* remember joint # for later *)
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/47L
2) case mode of
2) 1: begin (* set up force system, enable all cmons *)
2) e := gtVarn(spc↑.cf); (* remember what we're moving *)
2) mech := e↑.f;
2) if mech↑.ftype then (* check it's a device *)
2) if mech↑.dev = nil then
2) begin (* yow! frame that's not affixed to an arm *)
2) pp20L('Control frame not af',20); pp20('fixed to any device:',20);
2) pp20(' Assuming barm ',14); ppLine;
2) end;
***************
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
**** File 1) INTERP.PAS[AL,HE]/48P/113L
1) case ntype of
1) ffnode: ffr := cl;
1) stiffnode: stiff := cl;
1) gathernode: gather := cl;
1) wristnode: zwrist := cl;
1) forcenode: useForce := useForce + 1;
1) cmonnode: if cmon↑.oncond↑.ntype = forcenode then cmForce := cmForce + 1;
1) others: begin (* don't care *) end;
1) end;
1) cl := next;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/67L
2) if ntype = ffnode then ffr := cl
2) else if ntype = stiffnode then stiff := cl
2) else if ntype = gathernode then gather := cl
2) else if ntype = wristnode then zwrist := cl
2) else if ntype = forcenode then useForce := useForce + 1
2) else if ntype = cmonnode then
2) if cmon↑.oncond↑.ntype = forcenode then cmForce := cmForce + 1;
2) cl := next;
***************
**** File 1) INTERP.PAS[AL,HE]/48P/128L
1) msg↑.dev := mechbits; (* tell which arm *)
1) msg↑.bits := FTABLE; (* assume this *)
1) if ffr <> nil then
1) begin
1) val1 := getNval(ffr↑.ff,b); (* get force frame value *)
1) if not ffr↑.csys then msg↑.bits := 0;
1) sendTrans(val1↑.t); (* send command & trans over *)
1) if b then relNode(val1);
1) end
1) else sendTrans(niltrans); (* send command & trans over *)
1) signalArm; (* wake up ARM servo background job *)
1) end;
1) if zwrist <> nil then b := not zwrist↑.notp
1) else b := (ffr <> nil) or (stiff <> nil) or (cmForce + useForce > 0);
1) if b then
**** File 2) U:INTERP.PAS[AL2,RV]/47P/80L
2) (* deal with which arm here *) fbits := BLUARM; (* but for now... *)
2) if ffr <> nil then
2) begin
2) val := getNval(ffr↑.ff,b); (* get force frame value *)
2) if ffr↑.csys then fbits := fbits + FTABLE;
2) msg↑.bits := fbits;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
2) sendTrans(val↑.t); (* send command & trans over *)
2) if b then relNode(val);
2) end
2) else
2) begin
2) msg↑.bits := fbits + FTABLE;
2) sendTrans(niltrans); (* send command & trans over *)
2) end;
2) (* signalArm; (* wake up ARM servo background job *)
2) end;
2) if zwrist <> nil then b := zwrist↑.notp
2) else if (ffr <> nil) or (stiff <> nil) then b := true
2) else b := false;
2) if b then
***************
**** File 1) INTERP.PAS[AL,HE]/48P/146L
1) msg↑.dev := mechbits; (* tell which wrist *)
1) sendCmd;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/103L
2) sendCmd;
***************
**** File 1) INTERP.PAS[AL,HE]/48P/154L
1) with msg↑ do
**** File 2) U:INTERP.PAS[AL2,RV]/47P/110L
2) if stiff↑.coc <> nil then
2) begin
2) val := getNval(stiff↑.coc,b); (* get coc value *)
2) t := val↑.t;
2) end
2) else begin t := niltrans; b := false end;
2) with msg↑ do
***************
**** File 1) INTERP.PAS[AL,HE]/48P/157L
1) dev := mechbits; (* tell which arm *)
1) for i := 1 to 3 do
**** File 2) U:INTERP.PAS[AL2,RV]/47P/119L
2) for i := 1 to 3 do
***************
**** File 1) INTERP.PAS[AL,HE]/48P/164L
1) sendCmd; (* send stiffnesses over *)
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
1) if b1 then killNode(val1);
1) if b2 then killNode(val2);
1) end
**** File 2) U:INTERP.PAS[AL2,RV]/47P/125L
2) sendTrans(t); (* send stiffnesses & coc trans over *)
2) (* signalArm; (* wake up ARM servo background job *)
2) if b1 then killNode(val1);
2) if b2 then killNode(val2);
2) if b then relNode(val);
2) end
***************
**** File 1) INTERP.PAS[AL,HE]/48P/173L
1) dev := mechbits; (* tell which arm *)
1) for i := 1 to 3 do
**** File 2) U:INTERP.PAS[AL2,RV]/47P/136L
2) for i := 1 to 3 do
***************
**** File 1) INTERP.PAS[AL,HE]/48P/180L
1) sendCmd; (* send stiffnesses over *)
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/142L
2) sendTrans(niltrans); (* send stiffnesses & coc trans over *)
2) (* signalArm; (* wake up ARM servo background job *)
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/48P/185L
1) with msg↑ do
**** File 2) U:INTERP.PAS[AL2,RV]/47P/148L
2) (* deal with which arm here someday *)
2) with msg↑ do
***************
**** File 1) INTERP.PAS[AL,HE]/48P/188L
1) dev := mechbits; (* tell with which arm *)
1) bits := gather↑.gbits;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/152L
2) bits := gather↑.gbits;
***************
**** File 1) INTERP.PAS[AL,HE]/48P/194L
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
1) if useForce > 0 then (* any bias forces? *)
1) begin
**** File 2) U:INTERP.PAS[AL2,RV]/47P/157L
2) if ffr <> nil then (* no bias forces if no force frame *)
2) begin
***************
**** File 1) INTERP.PAS[AL,HE]/48P/202L
1) val1 := getNval(cl↑.fval,b); (* get force magnitude *)
1) r := val1↑.s;
1) if b then relnode(val1);
1) fbits := forcebits(cl,b);
1) if b then r := -r;
1) with msg↑ do
**** File 2) U:INTERP.PAS[AL2,RV]/47P/165L
2) val := getNval(cl↑.fval,b); (* get force magnitude *)
2) r := val↑.s;
2) if b then relnode(val);
2) fbits := forcebits(cl,b);
2) if b then r := -r;
2) (* deal with which arm here *) fbits := fbits + BLUARM; (* but for now... *)
2) with msg↑ do
***************
**** File 1) INTERP.PAS[AL,HE]/48P/210L
1) dev := mechbits; (* tell with which arm *)
1) bits := fbits;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/174L
2) bits := fbits;
***************
**** File 1) INTERP.PAS[AL,HE]/48P/222L
1) if jointp then push(val);
1) mode := 2;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/185L
2) mode := 2;
***************
**** File 1) INTERP.PAS[AL,HE]/48P/231L
1) if jointp then
1) begin val := pop; jtnum := round(val↑.s); relNode(val) end;
1) nsegs := 0;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/193L
2) nsegs := 0;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
***************
**** File 1) INTERP.PAS[AL,HE]/48P/236L
1) else fr := garm
1) else fr := mech;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/196L
2) else fr := barm
2) else fr := mech;
***************
**** File 1) INTERP.PAS[AL,HE]/48P/241L
1) bydest := nil;
1) wobble := nil;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/201L
2) wobble := nil;
***************
**** File 1) INTERP.PAS[AL,HE]/48P/245L
1) elbow := nil;
1) shoulder := nil;
1) flip := nil;
1) load := nil;
1) linear := nil;
1) arrv := nil;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/204L
2) arrv := nil;
***************
**** File 1) INTERP.PAS[AL,HE]/48P/253L
1) if not jointp then
1) begin
1) apprp := true; (* assume default approach *)
1) deprp := fr↑.depr <> nil; (* default departure if last had approach *)
1) end
1) else
1) begin
1) apprp := false; (* joint moves don't use default deproaches *)
1) deprp := false;
1) end;
1) cl := spc↑.clauses;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/207L
2) apprp := true; (* assume default approach *)
2) deprp := fr↑.depr <> nil; (* default departure if last had approach *)
2) cl := spc↑.clauses;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
***************
**** File 1) INTERP.PAS[AL,HE]/48P/267L
1) case ntype of
1) destnode: begin dest := cl; nsegs := nsegs + 1 end;
1) wobblenode: wobble := cl;
1) elbownode: elbow := cl;
1) shouldernode: shoulder := cl;
1) flipnode: flip := cl;
1) loadnode: load := cl;
1) sfacnode: sfac := cl;
1) durnode: dur := cl;
1) linearnode: linear := cl;
1) nullingnode: nulling := notp;
1) apprnode: begin
1) appr := cl;
1) if loc = nil then apprp := false (* approach = nildeproach *)
1) else begin apprp := true; nsegs := nsegs + 1 end
1) end;
1) deprnode: begin
1) depr := cl;
1) if loc = nil then deprp := false (* departure = nildeproach *)
1) else begin deprp := true; nsegs := nsegs + 1 end
1) end;
1) viaptnode: nsegs := nsegs + 1;
1) byptnode: begin bydest := cl; nsegs := nsegs + 1 end;
1) cmonnode: if cmon↑.oncond↑.ntype = arrivalnode then arrv := cmon↑.oncond;
1) others: begin (* don't care *) end;
1) end;
1) cl := next;
1) end;
1) if (dest <> nil) then bydest := nil
1) else apprp := appr <> nil; (* no default approach if no dest *)
1) if mech↑.ftype then tb := feval(mech); (* get current cf position *)
1) if deprp and (depr = nil) then
1) nsegs := nsegs + 1; (* add in default departure seg *)
1) if apprp and (appr = nil) then
1) with dest↑.loc↑ do (* add default approach point *)
1) if ((ntype = leafnode) and (ltype = varitype)) or
**** File 2) U:INTERP.PAS[AL2,RV]/47P/213L
2) if ntype = destnode then begin dest := cl; nsegs := nsegs + 1 end
2) else if ntype = wobblenode then wobble := cl
2) else if ntype = sfacnode then sfac := cl
2) else if ntype = durnode then dur := cl
2) else if ntype = nullingnode then nulling := notp
2) else if ntype = apprnode then
2) begin
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
2) appr := cl;
2) if loc = nil then apprp := false (* approach = nildeproach *)
2) else begin apprp := true; nsegs := nsegs + 1 end
2) end
2) else if ntype = deprnode then
2) begin
2) depr := cl;
2) if loc = nil then deprp := false (* departure = nildeproach *)
2) else begin deprp := true; nsegs := nsegs + 1 end
2) end
2) else if ntype = viaptnode then nsegs := nsegs + 1
2) else if ntype = cmonnode then
2) begin
2) if cmon↑.oncond↑.ntype = arrivalnode then arrv := cmon↑.oncond;
2) end;
2) cl := next;
2) end;
2) if deprp or mech↑.ftype then
2) tb := feval(mech); (* get current cf position *)
2) if deprp then
2) if depr <> nil then (* explicit departure point? *)
2) tb↑.refcnt := tb↑.refcnt + 1 (* need it to compute departure *)
2) else nsegs := nsegs + 1; (* add in default departure seg *)
2) if apprp and (appr = nil) then (* default approach point? *)
2) with dest↑.loc↑ do
2) if ((ntype = leafnode) and (ltype = varitype)) or
***************
**** File 1) INTERP.PAS[AL,HE]/48P/310L
1) t := ttmul(tb,tinvrt(t)); (* compute offset *)
1) end
1) else t := niltrans; (* no offset needed *)
1) with msg↑ do
**** File 2) U:INTERP.PAS[AL2,RV]/47P/253L
2) t := ttmul(t,tinvrt(tb)); (* compute offset *)
2) end
2) else t := nil; (* no offset needed *)
2) with msg↑ do
***************
**** File 1) INTERP.PAS[AL,HE]/48P/318L
1) if jointp then
1) case jtnum of
1) 1: bits := Joint1cb;
1) 2: bits := Joint2cb;
1) 3: bits := Joint3cb;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
1) 4: bits := Joint4cb;
1) 5: bits := Joint5cb;
1) 6: bits := Joint6cb;
1) others: bits := Joint1cb;
1) end
1) else bits := 0;
1) if nulling then bits := bits + Nullingcb;
1) if load <> nil then bits := bits + Loadcb;
1) if linear <> nil then (* straight line motion? *)
1) if linear↑.notp then bits := bits + Linearcb;
1) n := nsegs;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/261L
2) if nulling then bits := NULLINGCB else bits := 0;
2) n := nsegs;
***************
**** File 1) INTERP.PAS[AL,HE]/48P/352L
1) if dur↑.durrel < seqop then i := Durlbcb
1) else if dur↑.durrel > seqop then i := Durubcb
1) else i := Dureqcb;
1) msg↑.bits := msg↑.bits + i;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/281L
2) if dur↑.durrel < seqop then i := DURLBCB
2) else if dur↑.durrel > seqop then i := DURUBCB
2) else i := DUREQCB;
2) msg↑.bits := msg↑.bits + i;
***************
**** File 1) INTERP.PAS[AL,HE]/48P/363L
1) msg↑.bits := msg↑.bits + Wobblecb;
1) if b then relnode(val);
1) end;
1) sendTrans(t); (* tell arm we're starting a motion & what's being moved *)
1) if load <> nil then
1) with msg↑ do (* indicate load for arm *)
1) begin
1) cmd := setloadcmd;
1) if load↑.lcsys then bits := FTABLE (* in World or Hand? *)
1) else bits := FHAND;
1) val1 := getNval(load↑.loadval,b); (* mass of load *)
1) dur := val1↑.s;
1) if b then relnode(val1);
1) if load↑.loadvec <> nil then
1) begin
1) val1 := getNval(load↑.loadvec,b); (* where load is located *)
1) with val1↑.v↑ do
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
1) begin v1 := val[1]; v2 := val[2]; v3 := val[3] end;
1) if b then relnode(val1);
1) end
1) else begin v1 := 0; v2 := 0; v3 := 0 end;
1) end;
1) sendCmd; (* tell ARM about the load *)
1) msg↑.cmd := movesegcmd; (* now get values for trajectory points *)
**** File 2) U:INTERP.PAS[AL2,RV]/47P/292L
2) msg↑.bits := msg↑.bits + WOBBLECB;
2) if b then relnode(val);
2) end;
2) sendCmd; (* tell arm servo we're starting a motion *)
2) msg↑.cmd := movesegcmd; (* now get values for trajectory points *)
***************
**** File 1) INTERP.PAS[AL,HE]/48P/393L
1) msg↑.bits := Deptptcb;
1) setConfigBits; (* indicate any specified configuration *)
1) if depr = nil then tl := fr↑.depr (* default departure point *)
1) else
1) begin (* explicit departure point *)
1) msg↑.bits := Deptptcb + Byptcb; (* incremental motion *)
1) n := getNval(depr↑.loc,b);
1) getCode(depr↑.code);
1) if not jointp then tl := getDepr(n,b)
1) else sendJt(n↑.s,n,b);
1) end;
1) if not jointp then sendTrans(tl);
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/302L
2) msg↑.bits := DEPRPTCB;
2) if depr = nil then tl := fr↑.depr (* default departure point *)
2) else
2) begin (* explicit departure point *)
2) n := getNval(depr↑.loc,b);
2) tl := getDepr(n,b);
2) tb↑.refcnt := tb↑.refcnt - 1;
2) if tb↑.refcnt <= 0 then relTrans(tb); (* done with it now *)
2) getCode(depr↑.code);
2) end;
2) sendTrans(tl);
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/48P/411L
1) if (ntype = viaptnode) or (ntype = byptnode) then
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
1) begin (* VIA or BY: loc, duration, velocity & event *)
1) if ntype = viaptnode then msg↑.bits := Viaptcb
1) else if cl = bydest then msg↑.bits := Destptcb + Byptcb
1) else msg↑.bits := Viaptcb + Byptcb;
1) setConfigBits; (* indicate any specified configuration *)
1) if jointp then val1 := getNval(via,b1)
1) else if ntype = viaptnode then tb := getLoc(via)
1) else
1) begin
1) n := getNval(via,b);
1) if n↑.ltype = vectype then tb := tmake(niltrans,n↑.v) else tb := n↑.t;
1) if b then relnode(n);
1) end;
1) val2 := vclauses;
1) while val2 <> nil do (* check for any specified duration *)
1) if val2↑.ntype = durnode then
1) begin
1) val := getNval(val2↑.durval,b);
1) msg↑.dur := val↑.s;
1) if val2↑.durrel < seqop then i := Durlbcb
1) else if val2↑.durrel > seqop then i := Durubcb
1) else i := Dureqcb;
1) msg↑.bits := msg↑.bits + i;
1) if b then relNode(val);
1) val2 := nil;
1) end
1) else val2 := val2↑.next;
1) val2 := vclauses;
1) while val2 <> nil do (* check for any specified velocity *)
1) if val2↑.ntype = velocitynode then
1) begin
1) val := getNval(val2↑.clval,b);
1) msg↑.bits := msg↑.bits + Veloccb;
1) with val↑.v↑ do
1) begin
1) msg↑.v1 := val[1];
1) msg↑.v2 := val[2];
1) msg↑.v3 := val[3];
1) end;
1) if b then relNode(val);
1) val2 := nil;
1) end
1) else val2 := val2↑.next;
1) val2 := vclauses;
1) while val2 <> nil do (* finally deal with any configuration specs *)
1) begin
1) with msg↑ do
1) if val2↑.ntype = shouldernode then
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
1) begin
1) if shoulder = nil then
1) begin
1) bits := bits + Shouldercb;
1) if val2↑.notp then bits := bits + rightcb
1) end
1) else if val2↑.notp and (not shoulder↑.notp) then
1) bits := bits + rightcb
1) else if (not val2↑.notp) and shoulder↑.notp then
1) bits := bits - rightcb;
1) end
1) else if val2↑.ntype = elbownode then
1) begin
1) if elbow = nil then
1) begin
1) bits := bits + elbowcb;
1) if val2↑.notp then bits := bits + upcb
1) end
1) else if val2↑.notp and (not elbow↑.notp) then
1) bits := bits + upcb
1) else if (not val2↑.notp) and elbow↑.notp then
1) bits := bits - upcb;
1) end
1) else if val2↑.ntype = flipnode then
1) begin
1) if flip = nil then
1) begin
1) bits := bits + wristcb;
1) if val2↑.notp then bits := bits + flipcb
1) end
1) else if val2↑.notp and (not flip↑.notp) then
1) bits := bits + flipcb
1) else if (not val2↑.notp) and flip↑.notp then
1) bits := bits - flipcb;
1) end;
1) val2 := val2↑.next;
1) end;
1) getCode(cl↑.vcode);
1) if not jointp then sendTrans(tb) else sendJt(val1↑.s,val1,b1);
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/319L
2) if ntype = viaptnode then (* vias: loc, duration, velocity & event *)
2) begin
2) msg↑.bits := VIAPTCB;
2) tl := getLoc(via);
2) if duration <> nil then
2) begin
2) val := getNval(duration↑.durval,b);
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
2) msg↑.dur := val↑.s;
2) if duration↑.durrel < seqop then i := DURLBCB
2) else if duration↑.durrel > seqop then i := DURUBCB
2) else i := DUREQCB;
2) msg↑.bits := msg↑.bits + i;
2) if b then relnode(val);
2) end;
2) if velocity <> nil then
2) begin
2) val := getNval(velocity,b);
2) msg↑.bits := msg↑.bits + VELOCCB;
2) with val↑.v↑ do
2) begin
2) msg↑.v1 := val[1];
2) msg↑.v2 := val[2];
2) msg↑.v3 := val[3];
2) end;
2) if b then relnode(val);
2) end;
2) getCode(cl↑.vcode);
2) sendTrans(tl);
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/48P/505L
1) msg↑.bits := Apprptcb;
1) setConfigBits; (* indicate any specified configuration *)
1) if appr <> nil then
**** File 2) U:INTERP.PAS[AL2,RV]/47P/353L
2) msg↑.bits := APPRPTCB;
2) if appr <> nil then
***************
**** File 1) INTERP.PAS[AL,HE]/48P/512L
1) if not jointp then
1) begin
1) tb := getLoc(dest↑.loc); (* need to get destination location *)
1) tb↑.refcnt := tb↑.refcnt + 1; (* make sure we keep it for later *)
1) if appr <> nil then
1) begin
1) tl := getDepr(n,b); (* explicit approach point *)
1) tl := ttmul(tb,tl); (* shift to proper coord sys *)
1) end
1) else
1) begin (* default appoach point *)
1) tl := tvadd(tb,svmul(3,zhat));
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
1) (* if t <> nil then tl := ttmul(t,tl); now done by ARM *)
1) end;
1) tb↑.refcnt := tb↑.refcnt - 1;
1) upTrans(fr↑.appr,tl); (* save it for next motion *)
1) sendTrans(tl);
1) end
1) else
1) begin (* joint motion *)
1) val1 := getNval(dest↑.loc,b1); (* need to get destination location *)
1) r := val1↑.s + n↑.s; (* shift to proper coord sys *)
1) sendJt(r,n,b);
1) end
1) end
**** File 2) U:INTERP.PAS[AL2,RV]/47P/359L
2) tb := getLoc(dest↑.loc); (* need to get destination location *)
2) tb↑.refcnt := tb↑.refcnt + 1; (* make sure we keep it for later *)
2) if appr <> nil then tl := getDepr(n,b) (* explicit approach point *)
2) else
2) begin (* default appoach point *)
2) tl := tvadd(tb,svmul(3,zhat));
2) if t <> nil then tl := ttmul(t,tl);
2) end;
2) tb↑.refcnt := tb↑.refcnt - 1;
2) upTrans(fr↑.appr,tl); (* save it for next motion *)
2) sendTrans(tl);
2) end
***************
**** File 1) INTERP.PAS[AL,HE]/48P/539L
1) if dest <> nil then
1) if not jointp then tb := getLoc(dest↑.loc) (* get dest for below *)
1) else val1 := getNval(dest↑.loc,b1);
1) upTrans(fr↑.appr,nil); (* remember no default depr for next motion *)
**** File 2) U:INTERP.PAS[AL2,RV]/47P/373L
2) tb := getLoc(dest↑.loc); (* get destination for below *)
2) upTrans(fr↑.appr,nil); (* remember no default depr for next motion *)
***************
**** File 1) INTERP.PAS[AL,HE]/48P/545L
1) if jointp then
1) begin tb := newTrans; tb↑.val[1,1] := val1↑.s; tb↑.val[1,2] := jtnum end;
1) uptrans(fr↑.tdest,tb); (* copy dest for later use *)
1) if dest <> nil then
1) begin
1) msg↑.bits := Destptcb;
1) setConfigBits; (* indicate any specified configuration *)
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 48,47
1) if arrv <> nil then
1) begin
1) with arrv↑.evar↑ do e := getVar(level,offset);
1) msg↑.evt := e↑.evt; (* event to signal for code *)
1) msg↑.bits := Destptcb + Codecb;
1) end;
1) if not jointp then sendTrans(tb) else sendJt(val1↑.s,val1,b1);
1) end;
1) mode := 3;
1) if version = 11 then
1) begin
1) signalArm; (* finally let background job deal with traj *)
1) curInt↑.status := devicewait;
1) curInt := nil;
1) resched := true; (* swap someone else in *)
1) end
1) else freeEvent(ev); (* sim ver *)
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/377L
2) uptrans(fr↑.tdest,tb); (* make a copy of dest for later use *)
2) msg↑.bits := DESTPTCB;
2) if arrv <> nil then
2) begin
2) with arrv↑.evar↑ do e := getVar(level,offset);
2) msg↑.evt := e↑.evt; (* event to signal for code *)
2) msg↑.bits := msg↑.bits + CODECB;
2) end;
2) sendTrans(tb);
2) (* signalArm; (* finally let background job deal with traj *)
2) mode := 3;
2) (* curInt↑.status := devicewait; (* don't for simulation version *)
2) (* curInt := nil;
2) (* resched := true; (* swap someone else in *)
2) freeEvent(ev); (* sim ver *)
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/48P/583L
1) else fr := garm
1) else fr := mech;
**** File 2) U:INTERP.PAS[AL2,RV]/47P/406L
2) else fr := barm
2) else fr := mech;
***************
**** File 1) INTERP.PAS[AL,HE]/49P/76L
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 49,48
1) if version = 11 then
1) begin
1) curInt↑.status := devicewait;
1) curInt := nil;
1) resched := true; (* swap someone else in *)
1) end
1) else freeEvent(ev); (* sim ver *)
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/48P/76L
2) (* curInt↑.status := devicewait; (* don't for simulation version *)
2) (* curInt := nil;
2) (* resched := true; (* swap someone else in *)
2) freeEvent(ev); (* sim ver *)
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/50P/2L
1) var dest,bydest,sfac,durcl,swt,cl,v: nodep; e: enventryp; ev: eventp;
1) opening,dtime,sf,swtime: real; mechbits: integer; b,nulling: boolean;
**** File 2) U:INTERP.PAS[AL2,RV]/49P/2L
2) var dest,sfac,durcl,swt,cl,v: nodep; e: enventryp; ev: eventp;
2) opening,dtime,sf,swtime: real; mechbits: integer; b,nulling: boolean;
***************
**** File 1) INTERP.PAS[AL,HE]/50P/22L
1) bydest := nil;
1) durcl := nil;
**** File 2) U:INTERP.PAS[AL2,RV]/49P/22L
2) durcl := nil;
***************
**** File 1) INTERP.PAS[AL,HE]/50P/31L
1) case ntype of
1) destnode: dest := cl;
1) byptnode: bydest := cl;
1) durnode: durcl := cl;
1) sfacnode: sfac := cl;
1) swtnode: swt := cl;
1) nullingnode: nulling := notp;
1) others: begin (* nothing to do *) end;
1) end;
1) cl := next;
**** File 2) U:INTERP.PAS[AL2,RV]/49P/30L
2) if ntype = destnode then dest := cl
2) else if ntype = durnode then durcl := cl
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 50,49
2) else if ntype = sfacnode then sfac := cl
2) else if ntype = swtnode then swt := cl
2) else if ntype = nullingnode then nulling := notp;
2) cl := next;
***************
**** File 1) INTERP.PAS[AL,HE]/50P/67L
1) if dest <> nil then
1) begin
**** File 2) U:INTERP.PAS[AL2,RV]/49P/62L
2) if dest = nil then
2) begin
2) opening := 0;
2) mech↑.sdest := -1; (* so we know there was no dest *)
2) end
2) else
2) begin
***************
**** File 1) INTERP.PAS[AL,HE]/50P/73L
1) end
1) else if bydest <> nil then
1) begin
1) v := getNval(bydest↑.loc,b); (* get opening value *)
1) opening := v↑.s;
1) mech↑.sdest := mech↑.sdest + opening; (* remember it *)
1) if b then relNode(v);
1) end
1) else
1) begin
1) opening := 0;
1) mech↑.sdest := -1; (* so we know there was no dest *)
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/49P/73L
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/50P/92L
1) if (dest <> nil) or (bydest <> nil) then
1) begin
1) pos := opening;
1) bits := bits + DESTPTCB; (* indicate we're specifying opening *)
1) if dest = nil then bits := bits + BYPTCB; (* tell ARM incremental motion *)
1) end
**** File 2) U:INTERP.PAS[AL2,RV]/49P/80L
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 50,49
2) if dest = nil then
2) begin
2) pos := 0.0;
2) if spc↑.stype = opentype then bits := 3 else bits := 1;
2) end
***************
**** File 1) INTERP.PAS[AL,HE]/50P/100L
1) pos := 0.0;
1) if spc↑.stype = opentype then bits := 3 else bits := 1;
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/49P/87L
2) pos := opening;
2) bits := bits + DESTPTCB; (* indicate we're specifying opening *)
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/50P/129L
1) if version = 11 then
1) begin
1) curInt↑.status := devicewait;
1) curInt := nil;
1) resched := true; (* swap someone else in *)
1) end
1) else freeEvent(ev); (* sim ver *)
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/49P/116L
2) (* curInt↑.status := devicewait; (* don't for simulation version *)
2) (* curInt := nil;
2) (* resched := true; (* swap someone else in *)
2) freeEvent(ev); (* sim ver *)
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/51P/26L
1) if version = 11 then
1) begin
1) curInt↑.status := devicewait;
1) curInt := nil;
1) resched := true; (* swap someone else in *)
1) end
1) else freeEvent(ev); (* sim ver *)
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/50P/26L
2) (* curInt↑.status := devicewait; (* don't for simulation version *)
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 51,50
2) (* curInt := nil;
2) (* resched := true; (* swap someone else in *)
2) freeEvent(ev); (* sim ver *)
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/52P/1L
1) procedure doArmmagic;
1) var e: enventryp; ev: eventp; np: nodep; i,j,k: integer;
1) begin
1) with curInt↑ do
1) case mode of
1) 1: begin
1) np := pop;
1) i := round(np↑.s); (* get # of arm magic command *)
1) relNode(np);
1) e := gtVarn(spc↑.dev); (* remember what we're moving *)
1) mech := e↑.f;
1) ev := getEvent; (* event to use for signalling when motion finishes *)
1) ev↑.count := -1;
1) ev↑.waitlist := curInt;
1) j := 0;
1) np := spc↑.iargs;
1) while np <> nil do begin np := np↑.next; j := j + 1 end; (* count args *)
1) with msg↑ do
1) begin
1) cmd := armmagiccmd;
1) n := i; (* command number *)
1) dev := getMechbits;
1) bits := j;
1) evt := ev;
1) sendCmd; (* initiate the armmagic operation *)
1) for i := 1 to j do
1) begin (* send over the arguments *)
1) np := pop; (* get next argument *)
1) if np↑.ltype = svaltype then
1) begin
1) cmd := realcmd;
1) dur := np↑.s
1) end
1) else if np↑.ltype = vectype then
1) begin
1) cmd := vectorcmd;
1) with np↑.v↑ do
1) begin
1) v1 := val[1]; (* copy vector *)
1) v2 := val[2];
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 52,51
1) v3 := val[3];
1) end
1) end
1) else if np↑.ltype = transtype then
1) begin
1) cmd := transcmd;
1) with np↑.t↑ do
1) begin
1) for k := 1 to 3 do begin t[k] := val[k,1]; t[k+3] := val[k,2] end;
1) sendCmd; (* send first packet of trans over *)
1) for k := 1 to 3 do begin t[k] := val[k,3]; t[k+3] := val[k,4] end;
1) end;
1) end
1) else
1) begin (* error -- must be string type *)
1) pp20L('ARM MAGIC can''t hand',20); pp10('le strings',10); ppLine;
1) cmd := realcmd;
1) dur := 0.0; (* send a zero instead *)
1) end;
1) sendCmd; (* send real/vector/2nd-half-of-trans over *)
1) killNode(np); (* flush used stack entry *)
1) end;
1) end;
1) signalArm; (* start things happening *)
1) mode := 2;
1) if version = 11 then
1) begin
1) status := devicewait;
1) curInt := nil;
1) resched := true; (* swap someone else in *)
1) end
1) else
1) begin (* sim ver *)
1) freeEvent(ev);
1) np := spc↑.oargs;
1) while np <> nil do
1) begin (* clear any subscripts off of the stack *)
1) with np↑.lval↑ do
1) if ntype <> leafnode then
1) with arg1↑.vari↑ do
1) e := getVar(level,offset); (* look up env entry *)
1) np := np↑.next;
1) end
1) end;
1) end;
1) 2: begin
1) mode := 0; (* get ready for next statement *)
1) spc := spc↑.next;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 52,51
1) end
1) end;
1) end;
1) procedure doFloat;
1) var mechbits: integer; e: enventryp; cl,load,val1: nodep; b: boolean;
1) begin
**** File 2) U:INTERP.PAS[AL2,RV]/51P/1L
2) procedure doStop;
2) var mechbits: integer; e: enventryp;
2) begin
***************
**** File 1) INTERP.PAS[AL,HE]/53P/6L
1) load := nil;
1) cl := spc↑.clauses;
1) while cl <> nil do (* look for LOAD clause *)
1) with cl↑ do
1) begin
1) if ntype = loadnode then load := cl;
1) cl := next;
1) end;
1) if spc↑.cf = nil then mechbits := GARMDEV (* assume GARM *)
1) else
1) begin
1) e := gtVarn(spc↑.cf); (* see what we're floating *)
1) with e↑.f↑ do
**** File 2) U:INTERP.PAS[AL2,RV]/51P/6L
2) if spc↑.cf = nil then mechbits := getMechbits (* use current mech *)
2) else
2) begin
2) e := gtVarn(spc↑.cf); (* see what we're stopping *)
2) with e↑.f↑ do
***************
**** File 1) INTERP.PAS[AL,HE]/53P/24L
1) pp20L('Attempt to float a f',20); pp20('rame not affixed to ',20);
1) pp20('any device: Assuming',20); pp5(' GARM',5); ppLine;
1) mechbits := GARMDEV;
1) end
**** File 2) U:INTERP.PAS[AL2,RV]/51P/15L
2) pp20L('Attempt to stop fram',20); pp20('e not affixed to any',20);
2) pp20(' device: Assuming ba',20); pp5('rm ',2); ppLine;
2) mechbits := BARMDEV;
2) end
***************
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 53,51
**** File 1) INTERP.PAS[AL,HE]/53P/33L
1) cmd := floatcmd;
1) if load <> nil then bits := Loadcb else bits := 0;
1) dev := mechbits;
1) end;
1) sendCmd; (* tell arm servo to float device *)
1) if load <> nil then
1) with msg↑ do (* indicate load for arm *)
1) begin
1) cmd := setloadcmd;
1) if load↑.lcsys then bits := FTABLE (* in World or Hand? *)
1) else bits := FHAND;
1) val1 := getNval(load↑.loadval,b); (* mass of load *)
1) dur := val1↑.s;
1) if b then relnode(val1);
1) if load↑.loadvec <> nil then
1) begin
1) val1 := getNval(load↑.loadvec,b); (* where load is located *)
1) with val1↑.v↑ do
1) begin v1 := val[1]; v2 := val[2]; v3 := val[3] end;
1) if b then relnode(val1);
1) end
1) else begin v1 := 0; v2 := 0; v3 := 0 end;
1) end;
1) sendCmd; (* tell ARM about the load *)
1) mode := 0;
**** File 2) U:INTERP.PAS[AL2,RV]/51P/23L
2) cmd := stopcmd;
2) dev := mechbits;
2) end;
2) sendCmd; (* tell arm servo to stop device *)
2) mode := 0;
***************
**** File 1) INTERP.PAS[AL,HE]/54P/1L
1) procedure doStop;
1) var mechbits: integer; e: enventryp;
1) procedure complain;
1) begin (* yow! frame that's not affixed to a device *)
1) pp20L('Attempt to stop fram',20); pp20('e not affixed to any',20);
1) pp20(' device: Assuming ga',20); pp5('rm ',2); ppLine;
1) mechbits := GARMDEV;
1) end;
1) begin
**** File 2) U:INTERP.PAS[AL2,RV]/52P/1L
2) procedure doRetry;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 54,52
2) var b: boolean;
2) begin
***************
**** File 1) INTERP.PAS[AL,HE]/54P/14L
1) if spc↑.cf = nil then
1) if mech = nil then complain else mechbits := getMechbits (* use current mech *)
1) else
1) begin
1) e := gtVarn(spc↑.cf); (* see what we're stopping *)
1) with e↑.f↑ do
1) if ftype then
1) if dev <> nil then mechbits := dev↑.mech
1) else complain
1) else mechbits := mech;
1) end;
1) with msg↑ do
1) begin
1) cmd := stopcmd;
1) dev := mechbits;
1) end;
1) sendCmd; (* tell arm servo to stop device *)
1) mode := 0;
1) spc := spc↑.next;
1) end;
1) end;
1) procedure doRetry;
1) var b: boolean;
1) begin
**** File 2) U:INTERP.PAS[AL2,RV]/52P/6L
2) if spc↑.rparent <> nil then
2) begin
2) b := true;
2) while b and (spc↑.olevel < getELev(env)) do
2) begin (* make sure all cmon's in outer environments have finished *)
2) b := cmonCheck;
2) if b then killEnv; (* flush all environments out to move *)
2) end;
2) if b then (* no cmons now running *)
2) begin
2) (* *** might need to clean up stack some here (fornodes) *** *)
2) spc := spc↑.rcode; (* go redo the previous motion *)
2) mode := 0;
2) end
2) else sleep(30); (* give cmons time to finish *)
2) end
2) else
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 54,52
2) begin
2) spc := spc↑.next; (* just go on to next statement *)
2) mode := 0;
2) end;
2) end;
2) end;
2) procedure doSetbase;
2) begin
***************
**** File 1) INTERP.PAS[AL,HE]/55P/6L
1) if spc↑.rparent <> nil then
1) begin
1) b := true;
1) while b and (spc↑.olevel < getELev(env)) do
1) begin (* make sure all cmon's in outer environments have finished *)
1) b := cmonCheck;
1) if b then killEnv; (* flush all environments out to move *)
1) end;
1) if b then (* no cmons now running *)
1) begin
1) (* *** might need to clean up stack some here (fornodes) *** *)
1) spc := spc↑.rcode; (* go redo the previous motion *)
1) mode := 0;
1) end
1) else sleep(30); (* give cmons time to finish *)
1) end
1) else
1) begin
1) spc := spc↑.next; (* just go on to next statement *)
1) mode := 0;
1) end;
1) end;
1) end;
1) procedure doSetbase;
1) var mechbits: integer; e: enventryp;
1) procedure complain;
1) begin (* yow! frame that's not affixed to a device *)
1) pp20L('Attempt to zero unkn',20); pp20('own wrist: assuming ',20);
1) pp5('GARM ',4); ppLine;
1) mechbits := GARMDEV;
1) end;
1) begin
**** File 2) U:INTERP.PAS[AL2,RV]/53P/5L
2) msg↑.cmd := zerowristcmd; (* tell ARM servo to zero wrist *)
2) sendCmd;
2) mode := 0;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 55,53
2) spc := spc↑.next;
2) end;
2) end;
2) procedure doWrist;
2) var fv,tv: enventryp; v: vectorp; i: integer;
2) begin
***************
**** File 1) INTERP.PAS[AL,HE]/56P/14L
1) if spc↑.cf = nil then complain
1) else
1) begin
1) e := gtVarn(spc↑.cf); (* see which wrist we're zeroing *)
1) with e↑.f↑ do
1) if ftype then
1) if dev <> nil then mechbits := dev↑.mech
1) else complain
1) else complain; (* currently scalar devices are no good *)
1) end;
1) msg↑.cmd := zerowristcmd; (* tell ARM servo to zero wrist *)
1) msg↑.dev := mechbits;
1) sendCmd;
1) mode := 0;
**** File 2) U:INTERP.PAS[AL2,RV]/54P/6L
2) fv := gtVarn(spc↑.fvec); (* get where to store results *)
2) tv := gtVarn(spc↑.tvec);
2) if fv↑.v <> nil then (* flush any old values *)
2) with fv↑.v↑ do
2) begin
2) refcnt := refcnt - 1;
2) if refcnt <= 0 then relVector(fv↑.v);
2) end;
2) if tv↑.v <> nil then
2) with tv↑.v↑ do
2) begin
2) refcnt := refcnt - 1;
2) if refcnt <= 0 then relVector(tv↑.v);
2) end;
2) msg↑.cmd := wristcmd;
2) getReply; (* have ARM servo read wrist *)
2) v := newVector;
2) for i := 1 to 3 do v↑.val[i] := msg↑.t[i];
2) fv↑.v := v; (* store away force vector *)
2) v↑.refcnt := 1;
2) v := newVector;
2) for i := 1 to 3 do v↑.val[i] := msg↑.t[i+3];
2) tv↑.v := v; (* store away torque vector *)
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 56,54
2) v↑.refcnt := 1;
2) mode := 0;
***************
**** File 1) INTERP.PAS[AL,HE]/57P/1L
1) procedure doWrist;
1) var e,fv,tv: enventryp; b: boolean;
1) t: transp; v: vectorp; i: integer; val: nodep;
1) procedure complain;
1) begin (* yow! frame that's not affixed to a device *)
1) pp20L('Attempt to read unkn',20); pp20('own wrist: assuming ',20);
1) pp5('GARM ',4); ppLine;
1) i := GARMDEV;
1) end;
1) begin
1) with curInt↑ do
1) begin
1) if spc↑.arm = nil then complain
1) else
1) begin
1) e := gtVarn(spc↑.arm); (* see which wrist we're zeroing *)
1) with e↑.f↑ do
1) if ftype then
1) if dev <> nil then i := dev↑.mech
1) else complain
1) else complain; (* currently scalar devices are no good *)
1) end;
1) if spc↑.ff <> nil then
1) begin
1) val := getNval(spc↑.ff,b); (* get force frame value *)
1) t := val↑.t;
1) end
1) else begin t := niltrans; b := false end;
1) fv := gtVarn(spc↑.fvec); (* get where to store results *)
1) tv := gtVarn(spc↑.tvec);
1) if fv↑.v <> nil then (* flush any old values *)
1) with fv↑.v↑ do
1) begin
1) refcnt := refcnt - 1;
1) if refcnt <= 0 then relVector(fv↑.v);
1) end;
1) if tv↑.v <> nil then
1) with tv↑.v↑ do
1) begin
1) refcnt := refcnt - 1;
1) if refcnt <= 0 then relVector(tv↑.v);
1) end;
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 57,55
1) with msg↑ do
1) begin
1) cmd := wristcmd;
1) dev := i;
1) if spc↑.csys then bits := FTABLE else bits := FHAND;
1) end;
1) sendTrans(t); (* send command & trans over *)
1) if b then relNode(val);
1) getReply(false); (* have ARM servo read wrist *)
1) v := newVector;
1) for i := 1 to 3 do v↑.val[i] := msg↑.t[i];
1) fv↑.v := v; (* store away force vector *)
1) v↑.refcnt := 1;
1) v := newVector;
1) for i := 1 to 3 do v↑.val[i] := msg↑.t[i+3];
1) tv↑.v := v; (* store away torque vector *)
1) v↑.refcnt := 1;
1) mode := 0;
1) spc := spc↑.next;
1) end;
1) end;
1) (* command loop *)
**** File 2) U:INTERP.PAS[AL2,RV]/55P/1L
2) (* command loop *)
***************
**** File 1) INTERP.PAS[AL,HE]/58P/93L
1) breakNow := (mode = 0) and (spc↑.bpt or spc↑.bad);
1) end;
**** File 2) U:INTERP.PAS[AL2,RV]/55P/93L
2) if (mode = 0) and spc↑.bpt then breakNow := true;
2) end;
***************
**** File 1) INTERP.PAS[AL,HE]/58P/101L
1) if ch = chr(CR) then
1) begin (* process the line now *)
**** File 2) U:INTERP.PAS[AL2,RV]/55P/101L
2) if ch = chr(15B) then
2) begin (* process the line now *)
***************
**** File 1) INTERP.PAS[AL,HE]/58P/119L
1) else if (ord(ch) = ctlH) or (ord(ch) = deletekey) then (* backspace/delete *)
1) begin
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 58,55
**** File 2) U:INTERP.PAS[AL2,RV]/55P/119L
2) else if (ord(ch) = 10B) or (ord(ch) = 177B) then (* backspace/delete *)
2) begin
***************
**** File 1) INTERP.PAS[AL,HE]/58P/128L
1) else if ch <> chr(LF) then (* ignore linefeeds *)
1) begin
**** File 2) U:INTERP.PAS[AL2,RV]/55P/128L
2) else if ch <> chr(12B) then (* ignore linefeeds *)
2) begin
***************
**** File 1) INTERP.PAS[AL,HE]/58P/167L
1) saytype: doSay;
1) assigntype: doAssign;
**** File 2) U:INTERP.PAS[AL2,RV]/55P/167L
2) assigntype: doAssign;
***************
**** File 1) INTERP.PAS[AL,HE]/58P/176L
1) movetype,
1) jtmovetype: doMove;
1) operatetype: doOperate;
**** File 2) U:INTERP.PAS[AL2,RV]/55P/175L
2) movetype: doMove;
2) operatetype: doOperate;
***************
**** File 1) INTERP.PAS[AL,HE]/58P/182L
1) floattype: doFloat;
1) stoptype: doStop;
**** File 2) U:INTERP.PAS[AL2,RV]/55P/180L
2) stoptype: doStop;
***************
**** File 1) INTERP.PAS[AL,HE]/58P/187L
1) armmagictype: doArmmagic;
1) evaltype,
1) commenttype,
**** File 2) U:INTERP.PAS[AL2,RV]/55P/184L
2) commenttype,
***************
1) INTERP.PAS[AL,HE] and 2) U:INTERP.PAS[AL2,RV] 3-17-83 15:38 pages 58,55
**** File 1) INTERP.PAS[AL,HE]/58P/194L
1) dimdeftype: begin
1) if spc↑.stype = evaltype then
1) spc↑.aval := pop; (* get value for EDIT *)
1) mode := 0;
1) spc := spc↑.next; (* move on *)
1) end;
1) (* more??? *)
**** File 2) U:INTERP.PAS[AL2,RV]/55P/189L
2) dimdeftype: begin mode := 0; spc := spc↑.next; end; (* nothing to do *)
2) (* more??? *)
***************
**** File 1) INTERP.PAS[AL,HE]/58P/206L
1) running := not((mode = 0) and (spc↑.bpt or spc↑.bad));
1) if escapeI then
**** File 2) U:INTERP.PAS[AL2,RV]/55P/196L
2) running := not((mode = 0) and spc↑.bpt);
2) if escapeI then
***************